public function withError($message, $errorCode, array $headers = [])
    {
        return $this->withArray([
                'error' => [
                    'code' => $errorCode,
                    'http_code' => $this->statusCode,
                    'message' => $message
                ]
            ],
            $headers
        );
    }
public function withError($message, $errorCode, array $headers = [])
    {
        return $this->withArray([
                'error' => [
                    'code' => $errorCode,
                    'http_code' => $this->statusCode,
                    'message' => $message
                ]
            ],
            $headers
        );
    }
public function withError ( $ message , $ errorCode , array $ headers = [ ] ) { return $ this -> withArray ( [ 'error' => [ 'code' => $ errorCode , 'http_code' => $ this -> statusCode , 'message' => $ message ] ] , $ headers ) ; }
Response for errors

@param string $message
@param string $errorCode
@param array  $headers
@return mixed
Response for errors