Skip to content

Commit

Permalink
fix(AWS Local Invocation): Report invalid handler path meaningfully
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed May 19, 2021
1 parent 8f3d4e4 commit a2297ee
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/plugins/aws/invokeLocal/index.js
Expand Up @@ -749,6 +749,13 @@ class AwsInvokeLocal {
throw new Error(`Exception encountered when loading ${pathToHandler}`);
}

if (typeof lambda !== 'function') {
throw new ServerlessError(
`Lambda handler "${handlerPath}" does not point function property`,
'INVALID_LAMBDA_HANDLER_PATH'
);
}

function handleError(err) {
let errorResult;
if (err instanceof Error) {
Expand Down

0 comments on commit a2297ee

Please sign in to comment.