Skip to content

Arbitrary properties on new createError[code || name]([msg]))? #29

Description

@olalonde

Would be useful if we could pass arbitrary properties to errors using constructors. e.g.:

new createError[code || name]([msg],[properties]))

this would match the createError function signature. For example, right now we can do:

createError(402,'Your balance is too low.',{detail: {currentBalance: 100,price: 150,},})

but not

newcreateError.PaymentRequired('Your balance is too low.',{detail: {currentBalance: 100,price: 150,},})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions