Flugg\Responder\Http\ErrorResponseBuilder::buildErrorData PHP Method

buildErrorData() protected method

Build the error object of the serialized response data.
protected buildErrorData ( ) : array | null
return array | null
    protected function buildErrorData()
    {
        if (is_null($this->errorCode)) {
            return null;
        }
        $data = ['code' => $this->errorCode, 'message' => $this->message ?: $this->resolveMessage()];
        return array_merge($data, $this->data);
    }