In this video, we are going to change a lambda function code on a management console.
So let's get started.
In order to change a function code, we should go to the function and come to the code section.
And here you can see the code source.
So basically this is our function, but I would like to change our code with throwing an exception.
So for that purpose, I would like to put the first line of code as a true naive error and give the
description is a event should existing name, which is logging the incoming event.
So basically if we throwing an exception in the first line of code, these codes will not be work and
throwing exception in this line of code.
So let's try this exception code.
And first of all, we should deploy to quote this we deploy our new codes for naive invocations.
Otherwise these invocations will not be affected.
So that's why we should click the deploy first and see that we have successfully updated our function
code.
Now it is time to test our function code.
As you remember, that we have already created a test template, which is the test function payload.
So for that reason I'm going to click the test button directly in this window and click the test button.
This will send the request to our test function payload event and execute the invocation or lambda function
and our lambda function return response in here.
So as you can see that this is returning an error and the error message is in here eventually existing
in a and you can see the trace and details if you scroll down.
We can see also function logs which is already also written in the Amazon cloud, which looks and we
see the exact same error in the logs.
So basically lambda run our function code and the function handle receives the event and then respond
back to function response.
The function is throwing an exception and we see on the logs and let's also see these logs on the Amazon
cloud logs for that purpose, click the monitor and we in cloud watch logs.
And this time we will see the exception.
Log into Oracle.
Please open the latest log stream and see that in here.
We solve the error.
Log in here when I'm working our function.
The details listed in here.
So as you can see that we have changed the ADA Lambda Code and update the code, deploy the code and
after that, test the code and see the logs, error logs on the cloud.
Watch logs.