1082815dcSEvan Bacon"use strict"; 2082815dcSEvan Bacon 3082815dcSEvan BaconObject.defineProperty(exports, "__esModule", { 4082815dcSEvan Bacon value: true 5082815dcSEvan Bacon}); 6082815dcSEvan Baconexports.UnexpectedError = exports.PluginError = void 0; 7*84f418d7SKudo Chienfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 8*84f418d7SKudo Chienfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } 9*84f418d7SKudo Chienfunction _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } 10082815dcSEvan Baconclass UnexpectedError extends Error { 11082815dcSEvan Bacon constructor(message) { 12082815dcSEvan Bacon super(`${message}\nPlease report this as an issue on https://github.com/expo/expo-cli/issues`); 13082815dcSEvan Bacon _defineProperty(this, "name", 'UnexpectedError'); 14082815dcSEvan Bacon } 15082815dcSEvan Bacon} 16082815dcSEvan Baconexports.UnexpectedError = UnexpectedError; 17082815dcSEvan Bacon/** 18082815dcSEvan Bacon * Based on `JsonFileError` from `@expo/json-file` 19082815dcSEvan Bacon */ 20082815dcSEvan Baconclass PluginError extends Error { 21082815dcSEvan Bacon constructor(message, code, cause) { 22082815dcSEvan Bacon super(cause ? `${message}\n└─ Cause: ${cause.name}: ${cause.message}` : message); 23082815dcSEvan Bacon this.code = code; 24082815dcSEvan Bacon this.cause = cause; 25082815dcSEvan Bacon _defineProperty(this, "name", 'PluginError'); 26082815dcSEvan Bacon _defineProperty(this, "isPluginError", true); 27082815dcSEvan Bacon } 28082815dcSEvan Bacon} 29082815dcSEvan Baconexports.PluginError = PluginError; 30082815dcSEvan Bacon//# sourceMappingURL=errors.js.map