@shopify/app-bridge-core
Advanced tools
Comparing version 1.3.0-snapshot-20240610194018 to 1.3.0-snapshot-20240610203910
@@ -27,3 +27,3 @@ import { MetaAction, AnyAction } from '../types'; | ||
export declare type Payload = MetaAction | AnyAction; | ||
export declare class AppBridgeError { | ||
export declare class AppBridgeError extends Error { | ||
message: string; | ||
@@ -30,0 +30,0 @@ name: string; |
'use strict'; | ||
var tslib = require('tslib'); | ||
var types = require('../types.js'); | ||
@@ -34,16 +35,19 @@ var actions_helper = require('../helper.js'); | ||
})(exports.AppActionType || (exports.AppActionType = {})); | ||
var AppBridgeError = /** @class */ (function () { | ||
var AppBridgeError = /** @class */ (function (_super) { | ||
tslib.__extends(AppBridgeError, _super); | ||
function AppBridgeError(message) { | ||
this.name = 'AppBridgeError'; | ||
this.message = message; | ||
var _this = _super.call(this, message) || this; | ||
_this.name = 'AppBridgeError'; | ||
_this.message = message; | ||
Object.setPrototypeOf(_this, AppBridgeError.prototype); | ||
if (typeof Error.captureStackTrace === 'function') { | ||
Error.captureStackTrace(this, this.constructor); | ||
Error.captureStackTrace(_this, _this.constructor); | ||
} | ||
else { | ||
this.stack = new Error(this.message).stack; | ||
_this.stack = new Error(_this.message).stack; | ||
} | ||
return _this; | ||
} | ||
return AppBridgeError; | ||
}()); | ||
AppBridgeError.prototype = Object.create(Error.prototype); | ||
}(Error)); | ||
function fromAction(message, type, action) { | ||
@@ -50,0 +54,0 @@ var errorMessage = message ? type + ": " + message : type; |
@@ -32,3 +32,3 @@ import { Group } from '../types.js'; | ||
})(AppActionType || (AppActionType = {})); | ||
class AppBridgeError { | ||
class AppBridgeError extends Error { | ||
message; | ||
@@ -40,4 +40,6 @@ name; | ||
constructor(message) { | ||
super(message); | ||
this.name = 'AppBridgeError'; | ||
this.message = message; | ||
Object.setPrototypeOf(this, AppBridgeError.prototype); | ||
if (typeof Error.captureStackTrace === 'function') { | ||
@@ -51,3 +53,2 @@ Error.captureStackTrace(this, this.constructor); | ||
} | ||
AppBridgeError.prototype = Object.create(Error.prototype); | ||
function fromAction(message, type, action) { | ||
@@ -54,0 +55,0 @@ const errorMessage = message ? `${type}: ${message}` : type; |
{ | ||
"name": "@shopify/app-bridge-core", | ||
"version": "1.3.0-snapshot-20240610194018", | ||
"version": "1.3.0-snapshot-20240610203910", | ||
"types": "index.d.ts", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
432009
11882