public function setError(Throwable $error): void
    {
        $this->parameters['error']     = $error;
        $this->parameters['exit_code'] = $error->getCode() ?: 1;
    }
public function setError(Throwable $error): void
    {
        $this->parameters['error']     = $error;
        $this->parameters['exit_code'] = $error->getCode() ?: 1;
    }
public function setError ( Throwable $ error ) : void { $ this -> parameters [ 'error' ] = $ error ; $ this -> parameters [ 'exit_code' ] = $ error -> getCode ( ) ? : 1 ; }
Replaces the thrown exception.

This exception will be thrown if no response is set in the event.

@param \Throwable $error

@return void
Replaces the thrown exception .