UNPKG

@looker/sdk-rtl

Version:
49 lines (47 loc) 2.34 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LookerSDKError = void 0; var _excluded = ["errors", "documentation_url"]; function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var LookerSDKError = exports.LookerSDKError = (() => { 'use strict'; var LookerSDKErrorConstructor = function LookerSDKError() { for (var _len = arguments.length, errorArguments = new Array(_len), _key = 0; _key < _len; _key++) { errorArguments[_key] = arguments[_key]; } var [message, _ref = {}, ...rest] = errorArguments; var { errors, documentation_url } = _ref, errorOptions = _objectWithoutProperties(_ref, _excluded); var error = new Error(message, errorOptions, ...rest); Object.setPrototypeOf(error, this ? Object.getPrototypeOf(this) : LookerSDKError.prototype); Object.defineProperty(error, 'message', { enumerable: true }); error.errors = errors !== null && errors !== void 0 ? errors : []; error.documentation_url = documentation_url !== null && documentation_url !== void 0 ? documentation_url : ''; return error; }; Object.defineProperty(LookerSDKErrorConstructor, 'prototype', { value: Object.create(Error.prototype, { constructor: { value: LookerSDKErrorConstructor, writable: true, configurable: true }, name: { value: 'LookerSDKError', writable: true, configurable: true } }), writable: false }); return LookerSDKErrorConstructor; })(); //# sourceMappingURL=lookerSDKError.js.map