make recover return an error code