src/Worker.php
public function error(string $message)
    {
        $this->relay->send(
            $message,
            Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_RAW | Relay::PAYLOAD_ERROR
        );
    }
public function error(string $message)
    {
        $this->relay->send(
            $message,
            Relay::PAYLOAD_CONTROL | Relay::PAYLOAD_RAW | Relay::PAYLOAD_ERROR
        );
    }
public function error ( string $ message ) { $ this -> relay -> send ( $ message , Relay :: PAYLOAD_CONTROL | Relay :: PAYLOAD_RAW | Relay :: PAYLOAD_ERROR ) ; }
Respond to the server with an error. Error must be treated as TaskError and might not cause
worker destruction.

Example:

$worker->error("invalid payload");

@param string $message
Respond to the server with an error . Error must be treated as TaskError and might not cause worker destruction .