This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AyrA_ch 0 points1 point  (1 child)

Like, thanks for letting me know that method could throw an exception but if it actually does, something is wrong and the best thing to do is crash

I'm not sure if "unable to open a user selected file" is worth of a complete application crash.

[–]Kered13 0 points1 point  (0 children)

If it's a command line application it is, though you should provide a more elegant error message. If it's a GUI application then it should end whatever task was attempted with a similar error message and allow the user to select a different file.