protected function prepareJsonApiException(JsonApiException $ex)
    {
        $error = collect($ex->getErrors())->map(function (ErrorInterface $err) {
            return $err->getDetail() ?: $err->getTitle();
        })->filter()->first();

        return new HttpException($ex->getHttpCode(), $error, $ex);
    }