June 2017
Intermediate to advanced
400 pages
10h 32m
English
This recipe is a very basic example of how to catch panics. You can imagine with more complex middleware how you can defer a recover and catch it after running many nested functions. Within the recover, you can do basically anything you want, although emitting a log is common.
In most web applications, it's common to catch panics and emit an http.InternalServerError message when a panic occurs.
Read now
Unlock full access