| Total Complexity | 2 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 11 | #[Package('core')] |
||
| 12 | class ElasticsearchIndexingException extends HttpException |
||
| 13 | { |
||
| 14 | public const ES_DEFINITION_NOT_FOUND = 'ELASTICSEARCH_INDEXING__DEFINITION_NOT_FOUND'; |
||
| 15 | |||
| 16 | public const ES_INDEXING_ERROR = 'ELASTICSEARCH_INDEXING__INDEXING_ERROR'; |
||
| 17 | |||
| 18 | public static function definitionNotFound(string $definition): self |
||
| 19 | { |
||
| 20 | return new self( |
||
| 21 | Response::HTTP_BAD_REQUEST, |
||
| 22 | self::ES_DEFINITION_NOT_FOUND, |
||
| 23 | sprintf('Elasticsearch definition of %s not found', $definition), |
||
| 24 | ); |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param array{index: string, id: string, type: string, reason: string}[] $errors |
||
| 29 | */ |
||
| 30 | public static function indexingError(array $errors): ShopwareHttpException |
||
| 33 | } |
||
| 34 | } |
||
| 35 |