1
0
Fork 0
mirror of synced 2024-09-30 17:26:48 +13:00

Catch duplicate index exception when creating and updating a document

This commit is contained in:
kodumbeats 2021-08-18 14:49:49 -04:00
parent abc6ceb941
commit 758f8e8eb2

View file

@ -1307,6 +1307,9 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId')
catch (AuthorizationException $exception) {
throw new Exception('Unauthorized permissions', 401);
}
catch (DuplicateException $exception) {
throw new Exception($exception->getMessage(), 400);
}
catch (StructureException $exception) {
throw new Exception('Bad structure. '.$exception->getMessage(), 400);
}
@ -1369,4 +1372,3 @@ App::delete('/v1/database/collections/:collectionId/documents/:documentId')
;
$response->noContent();
});