public function getHttpStatus($default = null)
    {
        $default = $default ?: JsonApiException::DEFAULT_HTTP_CODE;
        $request = null;
        $internal = null;

        /** @var MutableErrorInterface $error */
        foreach ($this as $error) {

            $status = $error->getStatus();

            if (400 <= $status && 499 >= $status) {
                $request = is_null($request) ? $status : ($request == $status) ? $status : 400;
            } elseif (500 <= $status && 599 >= $status) {
                $internal = is_null($internal) ? $status : ($internal == $status) ? $status : 500;
            }
        }

        if (!$request && !$internal) {
            return $default;
        } elseif ($request && $internal) {
            return 500;
        }

        return $request ?: $internal;
    }