Thanks so much for the video! Could you please tell me what software you use to record your screen? It looks super nice. Tried using OBS and the built in Mac screen recorder but the recordings don't come out as sharp..
Exactly this. So if someone calls a function when this middleware is enabled then this recovery handler will effectively stop any panics from bringing down your app instance.
I actually agree... perhaps one point (as a new Go developer) that isn't clear to me is what's the purpose of even calling panic() if you're just going to recover() anyway? I mean (by way of example) if instead of calling panic(), why not just print an error message, discard malformed data (e.g., whatever) and continue the application?
This was really helpful. Thanks!
Glad it was helpful!
Thanks so much for the video! Could you please tell me what software you use to record your screen? It looks super nice. Tried using OBS and the built in Mac screen recorder but the recordings don't come out as sharp..
I'm not sure if I understood it correctly. In this case, does the recoveryHandler act as a middleware that will wrap our request handler?
Exactly this. So if someone calls a function when this middleware is enabled then this recovery handler will effectively stop any panics from bringing down your app instance.
I really hope they better ways to do error handling and panic because it sucks rocks
I actually agree... perhaps one point (as a new Go developer) that isn't clear to me is what's the purpose of even calling panic() if you're just going to recover() anyway? I mean (by way of example) if instead of calling panic(), why not just print an error message, discard malformed data (e.g., whatever) and continue the application?