UNPKG

@brimdata/zealot

Version:

The Javascript Client for Zed Lakes

24 lines (23 loc) 581 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "createError", { enumerable: true, get: ()=>createError }); const _utils = require("./utils"); function createError(input) { if (input instanceof Error) return input; if ((0, _utils.isObject)(input)) { const e = Object.assign(new Error(), input); if (input.error) { e.message = input.error; } if (input.kind) { e.name = input.kind; } return e; } return new Error(input); }