How to add error handling for all functions?

I am using it with go & aws lambda. I want to add rollbar to handle errors.

Is there any sample code or any ways for handling an error with generic code?

I was going to suggest Middy too, its a great addition. But @Hareramrai mentions they’re using Go so i don’t believe it will work. You’ll have to search for “lambda middleware” and see whats out there. I just saw one called Vesper (https://github.com/mefellows/vesper) but I don’t have any experience with it personally.