Ah, thank you.
@mathpunk As I recall, there is a function in the API to test if a result is a failure.