Where is your RETURN statement in the routine "sub_error"?