From 73a94ac2e6535a62efbc94e895d35171750068f5 Mon Sep 17 00:00:00 2001 From: Mike McNeil Date: Wed, 23 May 2018 22:27:39 -0500 Subject: [PATCH] Don't throw a special error when handler provided to .tolerate() throws -- instead just allow it through unscathed. --- lib/private/Deferred.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/private/Deferred.js b/lib/private/Deferred.js index f7c4966..75e60dd 100644 --- a/lib/private/Deferred.js +++ b/lib/private/Deferred.js @@ -964,17 +964,9 @@ function proceedToInterceptsAndChecks (errCbArg, resultCbArg, extraCbArgs, self, }, self._omen), resultCbArg, extraCbArgs, self, _cb, handleUncaughtException); } else { - // Otherwise, we'll just consider this a standard unexpected error: - return proceedToFinalAfterExecLC(flaverr({ - name: - 'UsageError', - message: - 'Encountered unexpected error in `.'+matchingUserlandLC.type+'()` handler. '+ - flaverr.parseOrBuildError(err).message+'\n'+ - ' [?] See https://sailsjs.com/support for help.', - raw: - err - }, self._omen), resultCbArg, extraCbArgs, self, _cb, handleUncaughtException); + // Otherwise, we'll allow this error through unscathed and treat it just like + // any unexpected error that might have been thrown by the implementation. + return proceedToFinalAfterExecLC(err, resultCbArg, extraCbArgs, self, _cb, handleUncaughtException); } }//•