UNPKG

extendable-http-errors

Version:

Extendable http error for node server using es2015, covers most HTTP default errors and allow extending them for custom errors.

10 lines (7 loc) 243 B
const InternalServerError = require('extendable-http-errors').httpErrors.InternalServerError; try { throw new Error("Oops"); } catch (err) { throw new InternalServerError("Something Not Good!", "HERE", 5001, {originalError: err}); }