Fix result handling of module:handle_error/3