Please stop using `error` and `ErrorException` in packages (and Base)

I see the value of fine-grained exceptions, especially if running in an application which can decide what to handle and what to fail on

Thing is, when you are writing a package you don’t know if the package is being used by a project which can decide what to handle and what to fail on.

Packages are for reuse.
That is why I am saying in packages, (not nesc in general),
avoid using error.
In a application (in the Pkg3 sense) go wild, use what ever error handling you want.

Like yes, the stack information always has what you need,
and the message often also has useful info.
But we don’t want to be doing exception handling via programatically inspecting the stack, or regexing the message

3 Likes