project-inra / inra-server

A set of modules for Node.js servers suitable for any kind of applications. Provides a higher level of abstraction, syntactic sugar and a lot of utility modules.
https://github.com/project-inra/inra-server/wiki
MIT License
8 stars 1 forks source link

Execute a custom callback on error #2

Closed Bartozzz closed 6 years ago

Bartozzz commented 6 years ago
defineError({
  instance: AuthError,,
  errorCode: 1000,
  httpStatus: 400,
  userMessage: "…",

  callback(err) {
    // …
  }
});
Bartozzz commented 6 years ago

Done in https://github.com/project-inra/inra-server/commit/7e16671900516909cd16efec66d820f139f8f788