UNPKG

node-web-mvc

Version:
21 lines (20 loc) 632 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Exception_1 = __importDefault(require("./Exception")); class Normalizer { static normalizeError(ex) { if (ex instanceof Error || (typeof ex === 'object' && ex)) { return ex; } else if (typeof ex === 'string') { return new Error(ex); } else { return new Exception_1.default('', ex); } } } exports.default = Normalizer;