|
17 | 17 | use Utopia\Database\Exception\Restricted as RestrictedException; |
18 | 18 | use Utopia\Database\Exception\Structure as StructureException; |
19 | 19 | use Utopia\Database\Exception\Timeout as TimeoutException; |
| 20 | +use Utopia\Database\Exception\Index as IndexException; |
20 | 21 | use Utopia\Database\Helpers\ID; |
21 | 22 | use Utopia\Database\Helpers\Permission; |
22 | 23 | use Utopia\Database\Helpers\Role; |
@@ -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