diff --git a/src/aura/lax/laxHelper.js b/src/aura/lax/laxHelper.js index b6699cd..01e4b45 100644 --- a/src/aura/lax/laxHelper.js +++ b/src/aura/lax/laxHelper.js @@ -101,7 +101,7 @@ } const errorConstructor = state === 'INCOMPLETE' ? errors.IncompleteActionError : errors.ApexActionError; - reject(errorConstructor.call({}, message, responseErrors)); + reject(new errorConstructor(message, responseErrors)); } }; } @@ -211,6 +211,11 @@ return util.createAuraContextPromise(promise); }, + finally: function (callback) { + const promise = this._contextPromise.finally(callback); + return util.createAuraContextPromise(promise); + }, + /** * * @method @@ -419,7 +424,7 @@ this.name = 'ApexActionError'; this.message = message; this.entries = entries; - Error.captureStackTrace(this, ApexActionError); + this.stack = (new Error()).stack } ApexActionError.prototype = Object.create(Error.prototype); ApexActionError.prototype.constructor = ApexActionError; @@ -429,7 +434,7 @@ this.name = 'IncompleteActionError'; this.message = message; this.entries = entries; - Error.captureStackTrace(this, IncompleteActionError); + this.stack = (new Error()).stack } IncompleteActionError.prototype = Object.create(Error.prototype); IncompleteActionError.prototype.constructor = IncompleteActionError;