4 ms·
Horrible looking magic strings there. Isn't it better to just throw typed exceptions? Then you can catch(MyCustomException).
by junto 12y ago
Horrible looking magic strings there. Isn't it better to just throw typed exceptions? Then you can catch(MyCustomException).
- zaroth 12y agoOften the only difference between encoding the type in a string, and encoding the type in a full-blown typed Exception is perhaps 'Find All References'. Typing the Exception can be a waste of typing and unnecessary cruft. More "structure" is not always better. If there's some unique data which must be carried back up the stack with the Exception it's a different story.