Panic Recovery in Go - Tutorial

Поділитися
Вставка
  • Опубліковано 6 лис 2024

КОМЕНТАРІ • 7

  • @mtushar
    @mtushar 2 роки тому +3

    This was really helpful. Thanks!

  • @salamander1782
    @salamander1782 2 роки тому

    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..

  • @Lucas-hh4oh
    @Lucas-hh4oh 2 роки тому +2

    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?

    • @Tutorialedge
      @Tutorialedge  2 роки тому

      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.

  • @wendellhatcher7011
    @wendellhatcher7011 Рік тому +1

    I really hope they better ways to do error handling and panic because it sucks rocks

    • @makingachanneltopost
      @makingachanneltopost 3 місяці тому

      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?