src/ResponseTrait.php
protected function getErrorResponse($msg, $errorCode, $statusText, $headers = [])
    {
        return $this->setStatusText($this->statusTexts[$statusText])
                    ->setStatusCode($statusText)
                    ->setStatusMessage(self::ERROR_TEXT)
                    ->setErrorCode($errorCode)
                    ->setErrorMessage($msg)
                    ->respondWithErrorMessage($headers);
    }
protected function getErrorResponse($msg, $errorCode, $statusText, $headers = [])
    {
        return $this->setStatusText($this->statusTexts[$statusText])
                    ->setStatusCode($statusText)
                    ->setStatusMessage(self::ERROR_TEXT)
                    ->setErrorCode($errorCode)
                    ->setErrorMessage($msg)
                    ->respondWithErrorMessage($headers);
    }
protected function getErrorResponse ( $ msg , $ errorCode , $ statusText , $ headers = [ ] ) { return $ this -> setStatusText ( $ this -> statusTexts [ $ statusText ] ) -> setStatusCode ( $ statusText ) -> setStatusMessage ( self :: ERROR_TEXT ) -> setErrorCode ( $ errorCode ) -> setErrorMessage ( $ msg ) -> respondWithErrorMessage ( $ headers ) ; }
Gets the error response

@param string $msg
@param int $errorCode
@param string $statusText
@param array $headers
@return json
Gets the error response