Wouldn't it be appropriate to throw an exception on failure instead?