protected function emitError($code, $msg)
    {
        $this->_status = self::STATUS_CLOSING;
        if ($this->onError) {
            try {
                call_user_func($this->onError, $this, $code, $msg);
            } catch (\Exception $e) {
                Worker::log($e);
                exit(250);
            } catch (\Error $e) {
                Worker::log($e);
                exit(250);
            }
        }
    }
protected function emitError($code, $msg)
    {
        $this->_status = self::STATUS_CLOSING;
        if ($this->onError) {
            try {
                call_user_func($this->onError, $this, $code, $msg);
            } catch (\Exception $e) {
                Worker::log($e);
                exit(250);
            } catch (\Error $e) {
                Worker::log($e);
                exit(250);
            }
        }
    }
protected function emitError ( $ code , $ msg ) { $ this -> _status = self :: STATUS_CLOSING ; if ( $ this -> onError ) { try { call_user_func ( $ this -> onError , $ this , $ code , $ msg ) ; } catch ( \ Exception $ e ) { Worker :: log ( $ e ) ; exit ( 250 ) ; } catch ( \ Error $ e ) { Worker :: log ( $ e ) ; exit ( 250 ) ; } } }
Try to emit onError callback.

@param int    $code
@param string $msg
@return void
Try to emit onError callback .