-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Description
#51673 opens a discussion on exceptions, but doesn't really seem to go anywhere.
We have a different angle to consider, thus I'm opening a separate issue: it is not unusual for packages to throw exceptions and embed user-provided data in the exception message. For security and privacy reasons, we do not want to log user-provided data so we cannot generally log exception messages which is quite annoying when you're trying to figure out why an exception was thrown.
It is impractical to verify the safety of the contents of exceptions thrown from all packages, but it is practical to do so for Base
. Unfortunately, even if we did this verification, there's no easy way to disambiguate an exception thrown from Base
from an exception thrown from a package... unless they are different exceptions.
To that end, we'd like to introduce an InternalException
and replace error()
calls in Base
with something that raises one of these. We could potentially go further and introduce a type hierarchy of internal exceptions that are only raised in Base
, but this might get complicated. We could then treat all InternalException
s as "safe to log".
Thoughts?