I am trying to deploy an AWS lambda function using serverless. We have configured a custom step to deploy our package via a serverless template. Note, we have manually installed Serverless in the octopus tentacle where the deployment is run.
We run the following C# deployment script expecting any errors to be caught during the serverless deployment but we are always getting an unhandled error in the attached screenshot. The deployment continues as the lambda function is successfully deployed but we always get this error, therefore each build is treated as a failure. Is there something we are not doing correctly?
The issue most likely comes from an exception inside one of the event handlers assigned to the proc object. Code in these event handlers is not being caught by the try/catch block in your code, so you need to wrap up the event handler code like this:
In particular the Exited event can get called twice under some circumstances, so these additional try/catch blocks will help you narrow down the cause of the problem.
thanks Matthew, we were getting the Exited event being called twice for some unknown reason so we have adapted our script to accomodate for this. It is now working as expected.