|
10 | 10 | use Utopia\Database\Exception\Conflict as ConflictException; |
11 | 11 | use Utopia\Database\Exception\Dependency as DependencyException; |
12 | 12 | use Utopia\Database\Exception\Duplicate as DuplicateException; |
| 13 | +use Utopia\Database\Exception\Index as IndexException; |
13 | 14 | use Utopia\Database\Exception\Limit as LimitException; |
14 | 15 | use Utopia\Database\Exception\NotFound as NotFoundException; |
15 | 16 | use Utopia\Database\Exception\Query as QueryException; |
@@ -1196,7 +1197,7 @@ public function createCollection(string $id, array $attributes = [], array $inde |
1196 | 1197 | ); |
1197 | 1198 | foreach ($indexes as $index) { |
1198 | 1199 | if (!$validator->isValid($index)) { |
1199 | | - throw new DatabaseException($validator->getDescription()); |
| 1200 | + throw new IndexException($validator->getDescription()); |
1200 | 1201 | } |
1201 | 1202 | } |
1202 | 1203 | } |
@@ -1934,7 +1935,7 @@ public function updateAttribute(string $collection, string $id, ?string $type = |
1934 | 1935 |
|
1935 | 1936 | foreach ($indexes as $index) { |
1936 | 1937 | if (!$validator->isValid($index)) { |
1937 | | - throw new DatabaseException($validator->getDescription()); |
| 1938 | + throw new IndexException($validator->getDescription()); |
1938 | 1939 | } |
1939 | 1940 | } |
1940 | 1941 | } |
@@ -2835,7 +2836,7 @@ public function createIndex(string $collection, string $id, string $type, array |
2835 | 2836 | $this->adapter->getInternalIndexesKeys() |
2836 | 2837 | ); |
2837 | 2838 | if (!$validator->isValid($index)) { |
2838 | | - throw new DatabaseException($validator->getDescription()); |
| 2839 | + throw new IndexException($validator->getDescription()); |
2839 | 2840 | } |
2840 | 2841 | } |
2841 | 2842 |
|
|
0 commit comments