2 ms·
My pet peeve is code along the lines of: if err != nil { // handle errors } Or: try { // something that can fail } catch (Exc
by jen20 2y ago
My pet peeve is code along the lines of:
if err != nil {
// handle errors
}
Or:
try {
// something that can fail
} catch (Exception e) {
// handle exceptions here
}
It's usually laziness from the author, but not stating _what types_ of error may occur and how should typically handle them is a plague on documentation and tutorials.