Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

formatError error ignores custom error properties #421

Closed
@teckays

Description

@teckays

I am throwing a custom error inside the resolver with additional parameters, unfortunately all custom fields are being stripped out from the formatError: error => {} callback.

// error 
class CustomError {
    constructor () {
        this.foo = 'bar'
    }
}

// resolver
try {
     throw new CustomError()
}

// graphQL
...
formatError: err => {
    console.log(err.foo) // undefined
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions