bedrock icon indicating copy to clipboard operation
bedrock copied to clipboard

Logging `BedrockError.cause` needs to be improved

Open mattcollier opened this issue 3 years ago • 0 comments

https://github.com/digitalbazaar/bedrock/blob/eaac0b907fcbb8c47ed70977efbeb7a781345c0a/lib/util.js#L80-L82

This code assumes that every cause would be a BedrockError that would be explicitly marked as public.

It is not common practice to wrap every error that might be included in a BedrockError in another BedrockError.

I think the practical solution here is to say that the cause should be logged if the outer BedrockError is marked as public.

This of course could mean that a cause leaks data that should not be exposed in logs. However, the current state of affairs makes it impossible to debug applications issues in deployments.

mattcollier avatar Nov 04 '22 20:11 mattcollier