|
2014-09-11 2:43 GMT+02:00 Rena <hyperhacker@gmail.com>:
> The idiom I've heard and used is that returning (nil, errmsg) is for
> runtime errors, and error() is for programming errors. So e.g.:
> return nil, "Failed to open file: access denied"
> vs:
> error("Invalid argument to method frobulate (expected number)")
The question one should ask is: could one reasonably expect
the calling routine have a nice way of recovering from this error?
If so, return nil,error_obj; otherwise abort.