Skip to content

Logging BedrockError.cause needs to be improved #108

@mattcollier

Description

@mattcollier

bedrock/lib/util.js

Lines 80 to 82 in eaac0b9

if(err.cause && !_isErrorPublic(err.cause)) {
object.cause = null;
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority 2Important but not critical

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions