{"action":"created","comment":{"url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments/65856153","id":65856153,"diff_hunk":"@@ -1034,7 +1034,14 @@ public boolean testRead(String[] args)\n \n     // initialize reader\n     long s = System.currentTimeMillis();\n-    reader.setId(id);\n+    try {\n+      reader.setId(id);\n+    } catch (FormatException exc) {\n+      reader.close();","path":"components/bio-formats-tools/src/loci/formats/tools/ImageInfo.java","position":8,"original_position":8,"commit_id":"06b6e0fd9c8a0c84966dfcda69c05fb3ad653966","original_commit_id":"06b6e0fd9c8a0c84966dfcda69c05fb3ad653966","user":{"login":"sbesson","id":1355463,"avatar_url":"https://avatars.githubusercontent.com/u/1355463?v=3","gravatar_id":"","url":"https://api.github.com/users/sbesson","html_url":"https://github.com/sbesson","followers_url":"https://api.github.com/users/sbesson/followers","following_url":"https://api.github.com/users/sbesson/following{/other_user}","gists_url":"https://api.github.com/users/sbesson/gists{/gist_id}","starred_url":"https://api.github.com/users/sbesson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbesson/subscriptions","organizations_url":"https://api.github.com/users/sbesson/orgs","repos_url":"https://api.github.com/users/sbesson/repos","events_url":"https://api.github.com/users/sbesson/events{/privacy}","received_events_url":"https://api.github.com/users/sbesson/received_events","type":"User","site_admin":false},"body":"Agreed. The most appropriate proposal I can come with might be to migrate this `try/catch` behavior into `FormatReader.setId(String)`. As there might be caveats we want to discuss with /cc @melissalinkert , I propose to push this change out of the PR and start by fixing the NPE.","created_at":"2016-06-06T08:55:08Z","updated_at":"2016-06-06T08:55:08Z","html_url":"https://github.com/openmicroscopy/bioformats/pull/2438#discussion_r65856153","pull_request_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2438","_links":{"self":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments/65856153"},"html":{"href":"https://github.com/openmicroscopy/bioformats/pull/2438#discussion_r65856153"},"pull_request":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2438"}}},"pull_request":{"url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2438","id":71574023,"html_url":"https://github.com/openmicroscopy/bioformats/pull/2438","diff_url":"https://github.com/openmicroscopy/bioformats/pull/2438.diff","patch_url":"https://github.com/openmicroscopy/bioformats/pull/2438.patch","issue_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2438","number":2438,"state":"open","locked":false,"title":"OME-TIFF: fix NPE when closing reader for partial multi-file filesets","user":{"login":"sbesson","id":1355463,"avatar_url":"https://avatars.githubusercontent.com/u/1355463?v=3","gravatar_id":"","url":"https://api.github.com/users/sbesson","html_url":"https://github.com/sbesson","followers_url":"https://api.github.com/users/sbesson/followers","following_url":"https://api.github.com/users/sbesson/following{/other_user}","gists_url":"https://api.github.com/users/sbesson/gists{/gist_id}","starred_url":"https://api.github.com/users/sbesson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbesson/subscriptions","organizations_url":"https://api.github.com/users/sbesson/orgs","repos_url":"https://api.github.com/users/sbesson/repos","events_url":"https://api.github.com/users/sbesson/events{/privacy}","received_events_url":"https://api.github.com/users/sbesson/received_events","type":"User","site_admin":false},"body":"See https://trac.openmicroscopy.org/ome/ticket/13107\r\n\r\nAt the Bio-Formats command-line tools level, this PR adds a `reader.close()` call if a `FormatException` is thrown by `reader.setId()` reproducing the NPE described in the ticket. In addition these exceptions are not handled more gracefully using logging and should return a non-zero return code.\r\n\r\nThis PR should be tested at using either one of the QA files linked to the ticket or any of the [multi-file OME-TIFF filesets](https://www.openmicroscopy.org/site/support/ome-model/ome-tiff/data.html#multi-file-ome-tiff-filesets) after deleting one of the TIFF files:\r\n- at the Bio-Formats level, `showinf /path/to/broken_image.ome.tiff` should print an error statement and the full stack trace should be shown when using `showinf -debug /path/to/broken_image.ome.tiff`\r\n- at the OMERO level, importing the partial fileset should still fail but the error should not longer be a NPE but instead a message about the nature of the error.\r\n","created_at":"2016-05-26T15:18:39Z","updated_at":"2016-06-06T08:55:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb030b38b1f702e3f547be3404f5d673cd3886ed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2438/commits","review_comments_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2438/comments","review_comment_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2438/comments","statuses_url":"https://api.github.com/repos/openmicroscopy/bioformats/statuses/06b6e0fd9c8a0c84966dfcda69c05fb3ad653966","head":{"label":"sbesson:13107_ometiff_close_npe","ref":"13107_ometiff_close_npe","sha":"06b6e0fd9c8a0c84966dfcda69c05fb3ad653966","user":{"login":"sbesson","id":1355463,"avatar_url":"https://avatars.githubusercontent.com/u/1355463?v=3","gravatar_id":"","url":"https://api.github.com/users/sbesson","html_url":"https://github.com/sbesson","followers_url":"https://api.github.com/users/sbesson/followers","following_url":"https://api.github.com/users/sbesson/following{/other_user}","gists_url":"https://api.github.com/users/sbesson/gists{/gist_id}","starred_url":"https://api.github.com/users/sbesson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbesson/subscriptions","organizations_url":"https://api.github.com/users/sbesson/orgs","repos_url":"https://api.github.com/users/sbesson/repos","events_url":"https://api.github.com/users/sbesson/events{/privacy}","received_events_url":"https://api.github.com/users/sbesson/received_events","type":"User","site_admin":false},"repo":{"id":3541327,"name":"bioformats","full_name":"sbesson/bioformats","owner":{"login":"sbesson","id":1355463,"avatar_url":"https://avatars.githubusercontent.com/u/1355463?v=3","gravatar_id":"","url":"https://api.github.com/users/sbesson","html_url":"https://github.com/sbesson","followers_url":"https://api.github.com/users/sbesson/followers","following_url":"https://api.github.com/users/sbesson/following{/other_user}","gists_url":"https://api.github.com/users/sbesson/gists{/gist_id}","starred_url":"https://api.github.com/users/sbesson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbesson/subscriptions","organizations_url":"https://api.github.com/users/sbesson/orgs","repos_url":"https://api.github.com/users/sbesson/repos","events_url":"https://api.github.com/users/sbesson/events{/privacy}","received_events_url":"https://api.github.com/users/sbesson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sbesson/bioformats","description":"Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the  Open Microscopy Environment (particularly  UW-Madison LOCI and  Glencoe Software). Bio-Formats is released under the  GNU General Public License (GPL); commercial licenses are available from  Glencoe Software. ","fork":true,"url":"https://api.github.com/repos/sbesson/bioformats","forks_url":"https://api.github.com/repos/sbesson/bioformats/forks","keys_url":"https://api.github.com/repos/sbesson/bioformats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sbesson/bioformats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sbesson/bioformats/teams","hooks_url":"https://api.github.com/repos/sbesson/bioformats/hooks","issue_events_url":"https://api.github.com/repos/sbesson/bioformats/issues/events{/number}","events_url":"https://api.github.com/repos/sbesson/bioformats/events","assignees_url":"https://api.github.com/repos/sbesson/bioformats/assignees{/user}","branches_url":"https://api.github.com/repos/sbesson/bioformats/branches{/branch}","tags_url":"https://api.github.com/repos/sbesson/bioformats/tags","blobs_url":"https://api.github.com/repos/sbesson/bioformats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sbesson/bioformats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sbesson/bioformats/git/refs{/sha}","trees_url":"https://api.github.com/repos/sbesson/bioformats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sbesson/bioformats/statuses/{sha}","languages_url":"https://api.github.com/repos/sbesson/bioformats/languages","stargazers_url":"https://api.github.com/repos/sbesson/bioformats/stargazers","contributors_url":"https://api.github.com/repos/sbesson/bioformats/contributors","subscribers_url":"https://api.github.com/repos/sbesson/bioformats/subscribers","subscription_url":"https://api.github.com/repos/sbesson/bioformats/subscription","commits_url":"https://api.github.com/repos/sbesson/bioformats/commits{/sha}","git_commits_url":"https://api.github.com/repos/sbesson/bioformats/git/commits{/sha}","comments_url":"https://api.github.com/repos/sbesson/bioformats/comments{/number}","issue_comment_url":"https://api.github.com/repos/sbesson/bioformats/issues/comments{/number}","contents_url":"https://api.github.com/repos/sbesson/bioformats/contents/{+path}","compare_url":"https://api.github.com/repos/sbesson/bioformats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sbesson/bioformats/merges","archive_url":"https://api.github.com/repos/sbesson/bioformats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sbesson/bioformats/downloads","issues_url":"https://api.github.com/repos/sbesson/bioformats/issues{/number}","pulls_url":"https://api.github.com/repos/sbesson/bioformats/pulls{/number}","milestones_url":"https://api.github.com/repos/sbesson/bioformats/milestones{/number}","notifications_url":"https://api.github.com/repos/sbesson/bioformats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sbesson/bioformats/labels{/name}","releases_url":"https://api.github.com/repos/sbesson/bioformats/releases{/id}","deployments_url":"https://api.github.com/repos/sbesson/bioformats/deployments","created_at":"2012-02-25T00:50:54Z","updated_at":"2015-05-07T13:40:01Z","pushed_at":"2016-06-04T21:23:17Z","git_url":"git://github.com/sbesson/bioformats.git","ssh_url":"git@github.com:sbesson/bioformats.git","clone_url":"https://github.com/sbesson/bioformats.git","svn_url":"https://github.com/sbesson/bioformats","homepage":"http://trac.openmicroscopy.org.uk/ome/wiki/BioFormats","size":261818,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"develop"}},"base":{"label":"openmicroscopy:develop","ref":"develop","sha":"b5a4eaf5b9e1b4797ac2328bcac303c09fda7e7f","user":{"login":"openmicroscopy","id":975861,"avatar_url":"https://avatars.githubusercontent.com/u/975861?v=3","gravatar_id":"","url":"https://api.github.com/users/openmicroscopy","html_url":"https://github.com/openmicroscopy","followers_url":"https://api.github.com/users/openmicroscopy/followers","following_url":"https://api.github.com/users/openmicroscopy/following{/other_user}","gists_url":"https://api.github.com/users/openmicroscopy/gists{/gist_id}","starred_url":"https://api.github.com/users/openmicroscopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmicroscopy/subscriptions","organizations_url":"https://api.github.com/users/openmicroscopy/orgs","repos_url":"https://api.github.com/users/openmicroscopy/repos","events_url":"https://api.github.com/users/openmicroscopy/events{/privacy}","received_events_url":"https://api.github.com/users/openmicroscopy/received_events","type":"Organization","site_admin":false},"repo":{"id":2510503,"name":"bioformats","full_name":"openmicroscopy/bioformats","owner":{"login":"openmicroscopy","id":975861,"avatar_url":"https://avatars.githubusercontent.com/u/975861?v=3","gravatar_id":"","url":"https://api.github.com/users/openmicroscopy","html_url":"https://github.com/openmicroscopy","followers_url":"https://api.github.com/users/openmicroscopy/followers","following_url":"https://api.github.com/users/openmicroscopy/following{/other_user}","gists_url":"https://api.github.com/users/openmicroscopy/gists{/gist_id}","starred_url":"https://api.github.com/users/openmicroscopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmicroscopy/subscriptions","organizations_url":"https://api.github.com/users/openmicroscopy/orgs","repos_url":"https://api.github.com/users/openmicroscopy/repos","events_url":"https://api.github.com/users/openmicroscopy/events{/privacy}","received_events_url":"https://api.github.com/users/openmicroscopy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openmicroscopy/bioformats","description":"Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the  Open Microscopy Environment (particularly  UW-Madison LOCI and  Glencoe Software). Bio-Formats is released under the  GNU General Public License (GPL); commercial licenses are available from  Glencoe Software. ","fork":false,"url":"https://api.github.com/repos/openmicroscopy/bioformats","forks_url":"https://api.github.com/repos/openmicroscopy/bioformats/forks","keys_url":"https://api.github.com/repos/openmicroscopy/bioformats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openmicroscopy/bioformats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openmicroscopy/bioformats/teams","hooks_url":"https://api.github.com/repos/openmicroscopy/bioformats/hooks","issue_events_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/events{/number}","events_url":"https://api.github.com/repos/openmicroscopy/bioformats/events","assignees_url":"https://api.github.com/repos/openmicroscopy/bioformats/assignees{/user}","branches_url":"https://api.github.com/repos/openmicroscopy/bioformats/branches{/branch}","tags_url":"https://api.github.com/repos/openmicroscopy/bioformats/tags","blobs_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/refs{/sha}","trees_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openmicroscopy/bioformats/statuses/{sha}","languages_url":"https://api.github.com/repos/openmicroscopy/bioformats/languages","stargazers_url":"https://api.github.com/repos/openmicroscopy/bioformats/stargazers","contributors_url":"https://api.github.com/repos/openmicroscopy/bioformats/contributors","subscribers_url":"https://api.github.com/repos/openmicroscopy/bioformats/subscribers","subscription_url":"https://api.github.com/repos/openmicroscopy/bioformats/subscription","commits_url":"https://api.github.com/repos/openmicroscopy/bioformats/commits{/sha}","git_commits_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/commits{/sha}","comments_url":"https://api.github.com/repos/openmicroscopy/bioformats/comments{/number}","issue_comment_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/comments{/number}","contents_url":"https://api.github.com/repos/openmicroscopy/bioformats/contents/{+path}","compare_url":"https://api.github.com/repos/openmicroscopy/bioformats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openmicroscopy/bioformats/merges","archive_url":"https://api.github.com/repos/openmicroscopy/bioformats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openmicroscopy/bioformats/downloads","issues_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues{/number}","pulls_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls{/number}","milestones_url":"https://api.github.com/repos/openmicroscopy/bioformats/milestones{/number}","notifications_url":"https://api.github.com/repos/openmicroscopy/bioformats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openmicroscopy/bioformats/labels{/name}","releases_url":"https://api.github.com/repos/openmicroscopy/bioformats/releases{/id}","deployments_url":"https://api.github.com/repos/openmicroscopy/bioformats/deployments","created_at":"2011-10-04T08:06:14Z","updated_at":"2016-05-31T12:37:34Z","pushed_at":"2016-06-05T20:12:57Z","git_url":"git://github.com/openmicroscopy/bioformats.git","ssh_url":"git@github.com:openmicroscopy/bioformats.git","clone_url":"https://github.com/openmicroscopy/bioformats.git","svn_url":"https://github.com/openmicroscopy/bioformats","homepage":"http://www.openmicroscopy.org/site/products/bio-formats","size":287735,"stargazers_count":102,"watchers_count":102,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":129,"mirror_url":null,"open_issues_count":29,"forks":129,"open_issues":29,"watchers":102,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2438"},"html":{"href":"https://github.com/openmicroscopy/bioformats/pull/2438"},"issue":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2438"},"comments":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2438/comments"},"review_comments":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2438/comments"},"review_comment":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2438/commits"},"statuses":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/statuses/06b6e0fd9c8a0c84966dfcda69c05fb3ad653966"}}}}
{"actor":{"display_login":"sbesson"}}