Skip to content

Commit

Permalink
fix(CLI): Fix resolution of handler in case of local fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Oct 1, 2021
1 parent 4ed34c3 commit 7d31410
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/cli/handle-error.js
Expand Up @@ -68,7 +68,7 @@ module.exports = async (exception, options = {}) => {
const localErrorHandlerData = (() => {
try {
return {
handle: require.resolve(path.resolve(localServerlessPath, 'lib/cli/handle-error')),
handle: require(path.resolve(localServerlessPath, 'lib/cli/handle-error')),
options: {
serverless,
isLocallyInstalled,
Expand All @@ -87,8 +87,7 @@ module.exports = async (exception, options = {}) => {
try {
// Ugly mock of serverless below is used to ensure that Framework version will be logged with `(local)` suffix
return {
handle: require.resolve(path.resolve(localServerlessPath, 'lib/classes/Error'))
.logError,
handle: require(path.resolve(localServerlessPath, 'lib/classes/Error')).logError,
options: {
serverless: serverless || { isLocallyInstalled },
forceExit: isUncaughtException,
Expand Down

0 comments on commit 7d31410

Please sign in to comment.