Yeah, I suppose I don't have much experience with distributed systems and hadn't considered exception handling.
For ActiveRecord (think model validation), I've used the pattern of appending to a list of errors and then doing @errors.any? to determine whether a call was successful or not - quite liked that. It kind of overkill if you want to bail at the first error though, since errors.count will always be 1.
That's a great post, thanks!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yeah, I suppose I don't have much experience with distributed systems and hadn't considered exception handling.
For ActiveRecord (think model validation), I've used the pattern of appending to a list of errors and then doing
@errors.any?
to determine whether a call was successful or not - quite liked that. It kind of overkill if you want to bail at the first error though, sinceerrors.count
will always be1
.That's a great post, thanks!