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,},})
Would be useful if we could pass arbitrary properties to errors using constructors. e.g.:
this would match the createError function signature. For example, right now we can do:
but not