Timeline for I've been told that Exceptions should only be used in exceptional cases. How do I know if my case is exceptional?
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 1, 2023 at 18:13 | comment | added | James M. Lay | Some people would prefer to call such a condition a "panic", instead of an exception, which is catchable within the program. | |
Jan 24, 2013 at 17:23 | history | edited | Robert Harvey | CC BY-SA 3.0 |
added 17 characters in body
|
Jan 24, 2013 at 16:26 | comment | added | Robert Harvey | @jmoreno: Ergo, you would use TryParse when the code could do something about the unparseable condition, and Parse when it could not. | |
Jan 24, 2013 at 16:25 | comment | added | jmoreno | +1, very close to what I was going to say. I would say it is more about scope, and really has nothing to do with the user. A good example of this is the difference between the two .Net functions int.Parse and int.TryParse, the former has no choice but to throw an exception on bad input, the later should never throw an exception | |
Jan 24, 2013 at 15:24 | history | answered | Robert Harvey | CC BY-SA 3.0 |