convertExceptionToError example

$errors = [];
            foreach ($exception->getErrors($debug) as $error) {
                $errors[] = $error;
            }

            /** @var array<ShopwareExceptionData> $errors */
            $errors = $this->convert($errors);

            return $errors;
        }

        return [$this->convertExceptionToError($exception$debug)];
    }

    private function getStatusCodeFromException(\Throwable $exception): int
    {
        if ($exception instanceof OAuthServerException) {
            return $exception->getHttpStatusCode();
        }

        if ($exception instanceof ShopwareHttpException || $exception instanceof HttpException) {
            return $exception->getStatusCode();
        }

        
Home | Imprint | This part of the site doesn't use cookies.