vektah / dataloaden

go generate based DataLoader
MIT License
530 stars 79 forks source link

Panics inside fetch are not recovered #31

Open edsrzf opened 5 years ago

edsrzf commented 5 years ago

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.

gracenoah commented 5 years ago

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.