UNPKG

@the-little-books/little

Version:

28 lines 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Unhandled = void 0; class Unhandled extends Error { constructor(value) { super(message_for_unhandled(value)); this.value = value; } } exports.Unhandled = Unhandled; function message_for_unhandled(value) { if (typeof value === "object" && value.abstract_class_name) { return ("unhandled class of abstract class\n" + `abstract_class_name: ${value.abstract_class_name}\n` + `value.constructor.name: ${value.constructor.name}\n` + `value: ${JSON.stringify(value, null, 2)}\n`); } else if (typeof value === "object") { return ("unhandled class of abstract class\n" + `value.constructor.name: ${value.constructor.name}\n` + `value: ${JSON.stringify(value, null, 2)}\n`); } else { return ("unhandled class of abstract class\n" + `value: ${JSON.stringify(value, null, 2)}\n`); } } //# sourceMappingURL=unhandled.js.map