Skip to content

Commit

Permalink
Keep the original error in registerAsyncTheme (#8977)
Browse files Browse the repository at this point in the history
refs #8945

- pass the original error as part of the errorDetails
- improves logging, so we know what really went wrong
- for debug purposes - can be removed at some point
  • Loading branch information
ErisDS authored and kirrg001 committed Sep 5, 2017
1 parent 71cee50 commit 69657a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/server/helpers/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ function asyncHelperWrapper(hbs, name, fn) {
}).catch(function asyncHelperError(err) {
var wrappedErr = err instanceof errors.GhostError ? err : new errors.IncorrectUsageError({
err: err,
context: 'registerAsyncThemeHelper: ' + name
context: 'registerAsyncThemeHelper: ' + name,
errorDetails: {
originalError: err
}
}),
result = config.get('env') === 'development' ? wrappedErr : '';

Expand Down

0 comments on commit 69657a1

Please sign in to comment.