{"action":"opened","issue":{"url":"https://api.github.com/repos/daler/pybedtools/issues/134","labels_url":"https://api.github.com/repos/daler/pybedtools/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/daler/pybedtools/issues/134/comments","events_url":"https://api.github.com/repos/daler/pybedtools/issues/134/events","html_url":"https://github.com/daler/pybedtools/issues/134","id":83521123,"number":134,"title":"Remote BedTools should throw exception when file not found","user":{"login":"sauliusl","id":108413,"avatar_url":"https://avatars.githubusercontent.com/u/108413?v=3","gravatar_id":"","url":"https://api.github.com/users/sauliusl","html_url":"https://github.com/sauliusl","followers_url":"https://api.github.com/users/sauliusl/followers","following_url":"https://api.github.com/users/sauliusl/following{/other_user}","gists_url":"https://api.github.com/users/sauliusl/gists{/gist_id}","starred_url":"https://api.github.com/users/sauliusl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sauliusl/subscriptions","organizations_url":"https://api.github.com/users/sauliusl/orgs","repos_url":"https://api.github.com/users/sauliusl/repos","events_url":"https://api.github.com/users/sauliusl/events{/privacy}","received_events_url":"https://api.github.com/users/sauliusl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-01T14:17:36Z","updated_at":"2015-06-01T14:17:36Z","closed_at":null,"body":"I am currently trying to get the unit tests running on my fork.\r\nOne of them `test_remote_bam`  fails because the file it is trying to fetch does not exist any more (will submit a PR skipping that test later on).\r\nIt fails, however, because the streamed iterator returns empty output, rather than throwing an appropriate exception. I believe this masks a problem, and thus I suggest adding this test into the suite, and make it pass:\r\n\r\n```python\r\ndef test_remote_bam_raises_exception_when_file_doesnt_exist():\r\n    x = pybedtools.BedTool('ftp://ftp-trace.ncbi.nih.gov/this/url/clearly/does/not/exist.bam', remote=True)\r\n    stream = x.bam_to_bed(stream=True)\r\n\r\n    assert_raises(IOError, next, stream.__iter__())\r\n```\r\n\r\n`IOError` might not be appropriate here though, and perhaps some Network-related exception should be used instead. Currently this test fails as `StopIteration` is thrown which is not right."}}