Plato on Github
Report Home
lib/routes/zerrorHandler.js
Maintainability
75.25
Lines of code
23
Difficulty
7.00
Estimated Errors
0.13
Function weight
By Complexity
By SLOC
/* @flow weak */ "use strict"; var errorHandler = module.exports = { }; var jsonApi = require("../jsonApi.js"); var helper = require("./helper.js"); var router = require("../router.js"); errorHandler.register = function() { router.bindErrorHandler(function(request, res, error) { if (jsonApi._errHandler) { jsonApi._errHandler(request, error); } return helper.handleError(request, res, { status: "500", code: "EUNKNOWN", title: "An unknown error has occured. Sorry?", detail: "??" }); }); };