protected function setResponseError($error, int $statusCode = 500) : void
    {
        if ($error instanceof \Exception) {
            $error = $error->getMessage();
        }

        $this->response['message'] = (string)$error;
        $this->response['status'] = $statusCode;
    }
protected function setResponseError($error, int $statusCode = 500) : void
    {
        if ($error instanceof \Exception) {
            $error = $error->getMessage();
        }

        $this->response['message'] = (string)$error;
        $this->response['status'] = $statusCode;
    }
protected function setResponseError ( $ error , int $ statusCode = 500 ) : void { if ( $ error instanceof \ Exception ) { $ error = $ error -> getMessage ( ) ; } $ this -> response [ 'message' ] = ( string ) $ error ; $ this -> response [ 'status' ] = $ statusCode ; }
Linkmobility always formats their errors like this, so we mimic this

@param string|\Exception $error
@param int $statusCode
Linkmobility always formats their errors like this so we mimic this