|
|
|
|
|
by closeparen
478 days ago
|
|
Corporate gRPC services are written with "if err != nil" for every operation at every layer between the API handler and the db/dependencies, with table-driven tests mocking each one for those sweet sweet coverage points. I would love a community norm that errors which fail the request can just be panics. Unfortunately that's not Go as she is written. |
|
1. Pass a context trace into every function, so that it can panic with richer meaning. That's a right pain very quickly.
2. Return errors, propagating them up the stack with more context: