3 ms·
How do you deal with something 15 layers deep that has an error? Bubble up the error through all those function returns (e.g. Go style)?
by Aeolun 4y ago
How do you deal with something 15 layers deep that has an error? Bubble up the error through all those function returns (e.g. Go style)?
- Cthulhu_ 4y agoIf needs be. But ideally you get to a point where an error turns into a business rule. SQL "no rows found" error? Becomes a business "record not found" error, which is turned into a HTTP 404 on an HTTP API edge.
- jstimpfle 4y agoDon't have call stacks 15 layers deep. It's a problem in itself when the only choice you have is either ignoring the error or cancelling 15 layers of god-knows-what-code-must-still-run.