{"action":"created","issue":{"url":"https://api.github.com/repos/visr/GDAL.jl/issues/19","repository_url":"https://api.github.com/repos/visr/GDAL.jl","labels_url":"https://api.github.com/repos/visr/GDAL.jl/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/visr/GDAL.jl/issues/19/comments","events_url":"https://api.github.com/repos/visr/GDAL.jl/issues/19/events","html_url":"https://github.com/visr/GDAL.jl/issues/19","id":143409469,"number":19,"title":"Relax null checking for certain methods","user":{"login":"yeesian","id":1231079,"avatar_url":"https://avatars.githubusercontent.com/u/1231079?v=3","gravatar_id":"","url":"https://api.github.com/users/yeesian","html_url":"https://github.com/yeesian","followers_url":"https://api.github.com/users/yeesian/followers","following_url":"https://api.github.com/users/yeesian/following{/other_user}","gists_url":"https://api.github.com/users/yeesian/gists{/gist_id}","starred_url":"https://api.github.com/users/yeesian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeesian/subscriptions","organizations_url":"https://api.github.com/users/yeesian/orgs","repos_url":"https://api.github.com/users/yeesian/repos","events_url":"https://api.github.com/users/yeesian/events{/privacy}","received_events_url":"https://api.github.com/users/yeesian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-03-25T02:28:48Z","updated_at":"2016-08-07T17:36:59Z","closed_at":null,"body":"I'm not sure if null checking should be performed (forcing downstream packages/users to wrap everything in a try-catch block) for cases in which you are expecting a null pointer to be returned. Case in point: https://github.com/visr/GDAL.jl/blob/master/src/ogr_api.jl#L3997-L4010\r\n\r\nThis came up when I was writing iterators for OGR feature layers, e.g. https://github.com/yeesian/GDALUtils.jl/blob/master/test/data1a.jl#L7-L13. I ended up using the C API instead: https://github.com/yeesian/GDALUtils.jl/blob/master/src/iteration.jl#L7-L8.\r\n\r\ncc @visr @meggart "},"comment":{"url":"https://api.github.com/repos/visr/GDAL.jl/issues/comments/238096271","html_url":"https://github.com/visr/GDAL.jl/issues/19#issuecomment-238096271","issue_url":"https://api.github.com/repos/visr/GDAL.jl/issues/19","id":238096271,"user":{"login":"rouault","id":1192433,"avatar_url":"https://avatars.githubusercontent.com/u/1192433?v=3","gravatar_id":"","url":"https://api.github.com/users/rouault","html_url":"https://github.com/rouault","followers_url":"https://api.github.com/users/rouault/followers","following_url":"https://api.github.com/users/rouault/following{/other_user}","gists_url":"https://api.github.com/users/rouault/gists{/gist_id}","starred_url":"https://api.github.com/users/rouault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rouault/subscriptions","organizations_url":"https://api.github.com/users/rouault/orgs","repos_url":"https://api.github.com/users/rouault/repos","events_url":"https://api.github.com/users/rouault/events{/privacy}","received_events_url":"https://api.github.com/users/rouault/received_events","type":"User","site_admin":false},"created_at":"2016-08-07T17:36:58Z","updated_at":"2016-08-07T17:36:58Z","body":"> OGRErr will be emitted (and hence should be checked)\r\n\r\nNot sure to understand the question. OGRErr is a type, used as the returned value of functions, which you can check in the signatures, so not something \"emitted\". \r\n\r\n> CPLError will be emitted (and should be checked; or whether GDAL will throw the error instead, and hence we should be wrapping it in a try-catch block)\r\n\r\nCPLError() can be called whether the return code of the function is successful or not, but I'd suggest that you can check with CPLGetLastErrorXXXX() when the return code is an error (or if you check always, do not error out if the error type was just a warning for example)\r\n\r\n> pointers will be emitted where C_NULL should/should-not be interpreted as an error\r\n\r\nDo you mean if a NULL pointer as the return of a function should be interpreted as an error ? That depends on the context. If a pointer is returned, and it is NULL, I would check CPLGetLastErrorType() == CE_Failure to determine if an exception (or whatever the mechanism is in Julia) must be thrown or not\r\n\r\n"}}
{"actor":{"display_login":"rouault"}}