I'd change this to return the value returned by `set_error_handler`, so that somebody would restore the previous error handler if desired, or re-register it.