event-driven-io / emmett

Emmett - a Node.js library taking your event-driven applications back to the future!
https://event-driven-io.github.io/emmett/
195 stars 19 forks source link

Made conventional error matching in `problemDetailsMiddleware` to be based on `errorCode` property #45

Closed oskardudycz closed 8 months ago

oskardudycz commented 8 months ago

TypeScript class comparison with an instance of can misbehave depending on the TS settings (see more here).

To remove that risk and make generic handling easier, the matching in problemDetailsMiddleware was updated to use regular structural matching on the errorCode property.