protected function normalizeErrorResponse($content, $data = null)
    {
        if ($content instanceof Arrayable) {
            $content = $content->toArray();
        }

        if ( ! is_array($content)) {
            $content = [
                'message' => $content,
            ];
        }

        if (null !== $data) {
            $content['data'] = $data;
        }

        return $content;
    }