mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Catch duplicate index exception when creating and updating a document
This commit is contained in:
@@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user