{"action":"created","issue":{"url":"https://api.github.com/repos/pngwriter/pngwriter/issues/82","labels_url":"https://api.github.com/repos/pngwriter/pngwriter/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/pngwriter/pngwriter/issues/82/comments","events_url":"https://api.github.com/repos/pngwriter/pngwriter/issues/82/events","html_url":"https://github.com/pngwriter/pngwriter/issues/82","id":130174083,"number":82,"title":"Add proper error handling","user":{"login":"mxmlnkn","id":6842824,"avatar_url":"https://avatars.githubusercontent.com/u/6842824?v=3","gravatar_id":"","url":"https://api.github.com/users/mxmlnkn","html_url":"https://github.com/mxmlnkn","followers_url":"https://api.github.com/users/mxmlnkn/followers","following_url":"https://api.github.com/users/mxmlnkn/following{/other_user}","gists_url":"https://api.github.com/users/mxmlnkn/gists{/gist_id}","starred_url":"https://api.github.com/users/mxmlnkn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxmlnkn/subscriptions","organizations_url":"https://api.github.com/users/mxmlnkn/orgs","repos_url":"https://api.github.com/users/mxmlnkn/repos","events_url":"https://api.github.com/users/mxmlnkn/events{/privacy}","received_events_url":"https://api.github.com/users/mxmlnkn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pngwriter/pngwriter/labels/api-change","name":"api-change","color":"207de5"},{"url":"https://api.github.com/repos/pngwriter/pngwriter/labels/refactoring","name":"refactoring","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/pngwriter/pngwriter/milestones/3","html_url":"https://github.com/pngwriter/pngwriter/milestones/Future","labels_url":"https://api.github.com/repos/pngwriter/pngwriter/milestones/3/labels","id":1299442,"number":3,"title":"Future","description":"Issues for future milestones that are not yet assigned to a specific release.","creator":{"login":"ax3l","id":1353258,"avatar_url":"https://avatars.githubusercontent.com/u/1353258?v=3","gravatar_id":"","url":"https://api.github.com/users/ax3l","html_url":"https://github.com/ax3l","followers_url":"https://api.github.com/users/ax3l/followers","following_url":"https://api.github.com/users/ax3l/following{/other_user}","gists_url":"https://api.github.com/users/ax3l/gists{/gist_id}","starred_url":"https://api.github.com/users/ax3l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ax3l/subscriptions","organizations_url":"https://api.github.com/users/ax3l/orgs","repos_url":"https://api.github.com/users/ax3l/repos","events_url":"https://api.github.com/users/ax3l/events{/privacy}","received_events_url":"https://api.github.com/users/ax3l/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":1,"state":"open","created_at":"2015-09-10T14:21:16Z","updated_at":"2016-02-02T12:08:43Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-01-31T19:50:38Z","updated_at":"2016-02-02T12:10:17Z","closed_at":null,"body":"Currently there is no error handling except prints with `std::err` and `perror`. This means, that it is hard to test if `readFromFile`failed or not. Currently it is done like this:\r\n\r\n    pngwriter png( 1, 1, 0, \"tmp.png\" );\r\n    png.readfromfile( \"input.png\" );\r\n    if ( png.getwidth() == 1 and png.getwidth() == 1 )\r\n        exit( EXIT_FAILURE );\r\n\r\nBut this check has a false positive for images of size 1x1. These are border cases, but the may not always be unimportant. It would be nice if `readFromFile` could return some error code."},"comment":{"url":"https://api.github.com/repos/pngwriter/pngwriter/issues/comments/178537462","html_url":"https://github.com/pngwriter/pngwriter/issues/82#issuecomment-178537462","issue_url":"https://api.github.com/repos/pngwriter/pngwriter/issues/82","id":178537462,"user":{"login":"ax3l","id":1353258,"avatar_url":"https://avatars.githubusercontent.com/u/1353258?v=3","gravatar_id":"","url":"https://api.github.com/users/ax3l","html_url":"https://github.com/ax3l","followers_url":"https://api.github.com/users/ax3l/followers","following_url":"https://api.github.com/users/ax3l/following{/other_user}","gists_url":"https://api.github.com/users/ax3l/gists{/gist_id}","starred_url":"https://api.github.com/users/ax3l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ax3l/subscriptions","organizations_url":"https://api.github.com/users/ax3l/orgs","repos_url":"https://api.github.com/users/ax3l/repos","events_url":"https://api.github.com/users/ax3l/events{/privacy}","received_events_url":"https://api.github.com/users/ax3l/received_events","type":"User","site_admin":false},"created_at":"2016-02-02T12:10:17Z","updated_at":"2016-02-02T12:10:17Z","body":"Absolutely, the current printf's should become clean C++ exceptions."}}