siilisolutions / hedge

a serverless solution for clojure
Eclipse Public License 1.0
39 stars 6 forks source link

Fix/implement single function deployment/invokation #23

Closed jikuja closed 6 years ago

jikuja commented 6 years ago

Handle missing non-existant function is serverless-hedge-plugin code.

AWS and Azure still will fail but error messages are more user friendly and more common than stacktraces from plugin code.

E.g. AWS plugin gives following error and stack when invoking locally with wrong function name:

ServerlessError: Function "calcFAILURE" doesn't exist in this Service
    at Service.getFunction (/usr/local/lib/node_modules/serverless/lib/classes/Service.js:195:11)
    at AwsInvokeLocal.extendedValidate (/usr/local/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:50:56)
From previous event:
    at Object.invoke:local:invoke [as hook] (/usr/local/lib/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:24:10)
    at BbPromise.reduce (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:366:55)
From previous event:
    at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:366:22)
    at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:397:17)
    at variables.populateService.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:104:33)
    at runCallback (timers.js:773:18)
    at tryOnImmediate (timers.js:734:5)
    at processImmediate [as _immediateCallback] (timers.js:711:5)
From previous event:
    at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:91:74)
    at serverless.init.then (/usr/local/lib/node_modules/serverless/bin/serverless:42:50)
    at <anonymous>
jikuja commented 6 years ago

Implemented and tested

Tested/fixed bad function name arguments

jikuja commented 6 years ago

Serverless plugin not in scope for Hedge anymore.