protected function onError(Exception $exception, ?callable $callback = null) : void
    {
        if (!is_null($callback)) {
            $callback($exception);
        }
    }
protected function onError(Exception $exception, ?callable $callback = null) : void
    {
        if (!is_null($callback)) {
            $callback($exception);
        }
    }
protected function onError ( Exception $ exception , ? callable $ callback = null ) : void { if ( ! is_null ( $ callback ) ) { $ callback ( $ exception ) ; } }
Handles async request failure.

@param \Exception    $exception
@param callable|null $callback

@return void
Handles async request failure .