5 ms·
> Should you instead handle every error close to their source I find that this is very rarely the case. Micro-operations failing means that a MUCH higher level
by knorker 6y ago
> Should you instead handle every error close to their source
I find that this is very rarely the case. Micro-operations failing means that a MUCH higher level operation has failed.
If there's an error writing to the output file descriptor from deep within the decompression library, do you know what failed? The HTTP request. What can the decompression library, the IDS inspector, the logging system, the tracing system, or anything else do? They can just pass along the error.
Hence so much "if err != nil { return err}" in Go. The vast VAST majority of errors are not handled, they are reported.
Verbose?
benchmark b("blah");
write(http_compress(logsize(backend_decompress(out_fd, in_fd)))
It's extremely rare that something can recover from an error. And the things that can be recovered from are not exceptions in C++ (though they seem to be in Java, brrr).