diff --git a/lib/errors/index.js b/lib/errors/index.js index 9713b7777f..5f6b4af510 100644 --- a/lib/errors/index.js +++ b/lib/errors/index.js @@ -31,13 +31,16 @@ class Exception { getErrorDetails(config) { const errorDetails = errorHelper.extractErrorInformation(null, this.error, config) - errorDetails.expected = errorHelper.isExpected( - errorDetails.type, - errorDetails.message, - null, - config, - urltils - ) + if (typeof this._expected === 'undefined') { + this._expected = errorHelper.isExpected( + errorDetails.type, + errorDetails.message, + null, + config, + urltils + ) + } + errorDetails.expected = this._expected return errorDetails }