|
|
|
|
|
by ori_b
2196 days ago
|
|
Does any language save you from explicitly screwing up error handling? Gorm is doing the Go equivalent of: class Query {
class QueryResult {
Exception error;
Value result;
}
public QueryResult query() {
try {
return doThing();
} catch(Exception e){
return new QueryResult(error, null);
}
}
}
Gorm is going out of its way to make error handling suck. |
|
It's about the default error handling method being sane. In exception based languages, an unhandled error bubbles up until it reaches a handler, or it crashes the program with a stacktrace.
Compare to what golang does, it's somewhat easy to accidentally ignore or overwrite errors. This leads to silent corruption of state, much worse than crashing the program outright.