Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • A file being in use by another program or your user not having rights to open the file aren't that rare. Commented Jan 14, 2017 at 12:46
  • @CodesInChaos, that's a good point. I guess I'm more interested in the general case of how to deal with returning something when I'd rather just quit execution in this case Commented Jan 14, 2017 at 12:53
  • That's what exceptions are for. Commented Jan 14, 2017 at 16:24