Skip to content

Commit

Permalink
fix(CLI): Improve error handler resolution
Browse files Browse the repository at this point in the history
Ensure it's bulletproof against serverless installation issues
  • Loading branch information
medikoo committed Dec 15, 2021
1 parent 3b4e453 commit 0dedd3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cli/handle-error.js
Expand Up @@ -4,6 +4,7 @@ const path = require('path');
const isObject = require('type/object/is');
const chalk = require('chalk');
const stripAnsi = require('strip-ansi');
const _ = require('lodash');
const sfeVersion = require('@serverless/dashboard-plugin/package.json').version;
const { platformClientVersion } = require('@serverless/dashboard-plugin');
const { getDashboardProvidersUrl } = require('@serverless/dashboard-plugin/lib/dashboard');
Expand Down Expand Up @@ -105,7 +106,7 @@ module.exports = async (exception, options = {}) => {
}
})();

if (localErrorHandlerData) {
if (_.get(localErrorHandlerData, 'handle')) {
localErrorHandlerData.handle(exception, localErrorHandlerData.options);
return;
}
Expand Down

0 comments on commit 0dedd3e

Please sign in to comment.