Panics that happen in the fetch function are not recovered, which means that a panic takes down the entire process. This could be something that I handle myself in every fetch function, but it seems like something that the generated code should handle.
I can think of a few approaches:
Always recover from panics in the template.
Allow specifying whether or not to recover from panics at code generation time.
Allow specifying a panic handler function in the loader's config object.
I think I'd lean toward the first, but thought I'd start a discussion. I'm happy to open a pull request once we decide on an approach.
I think option 3 will be necessary. We care very much about how errors are constructed and reported in our code base and generally library provided panic handlers hide a lot of information.
Panics that happen in the fetch function are not recovered, which means that a panic takes down the entire process. This could be something that I handle myself in every fetch function, but it seems like something that the generated code should handle.
I can think of a few approaches:
I think I'd lean toward the first, but thought I'd start a discussion. I'm happy to open a pull request once we decide on an approach.