4 ms·
Not sure why people don't like exceptions. Throw different error classes according to the source of the problem and just handle differently in the upper classes
by mekster 5y ago
Not sure why people don't like exceptions. Throw different error classes according to the source of the problem and just handle differently in the upper classes.
throw new ErrorUser('Bad input')
-> Show friendly error messages.
throw new ErrorFatal('Db unavailable')
-> Email error to dev and quit.
I never like the verbosity of returning errors from each methods.
How hard is it to trace the stack when you're supposed to be using error logging tools like Sentry?