feat: use general server errors in database API
This commit is contained in:
parent
c1aed2b64b
commit
8189dba42c
|
@ -407,11 +407,6 @@ return [
|
|||
'description' => 'The maximum number of collections has been reached.',
|
||||
'statusCode' => 400,
|
||||
],
|
||||
Exception::COLLECTION_DELETION_FAILED => [
|
||||
'name' => Exception::COLLECTION_DELETION_FAILED,
|
||||
'description' => 'Failed to delete the collection from the database.',
|
||||
'statusCode' => 500,
|
||||
],
|
||||
|
||||
/** Documents */
|
||||
Exception::DOCUMENT_NOT_FOUND => [
|
||||
|
|
|
@ -673,7 +673,7 @@ App::delete('/v1/database/collections/:collectionId')
|
|||
}
|
||||
|
||||
if (!$dbForProject->deleteDocument('collections', $collectionId)) {
|
||||
throw new Exception('Failed to remove collection from DB', 500, Exception::COLLECTION_DELETION_FAILED);
|
||||
throw new Exception('Failed to remove collection from DB', 500, Exception::GENERAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
$dbForProject->deleteCachedCollection('collection_' . $collectionId);
|
||||
|
|
|
@ -96,7 +96,6 @@ class Exception extends \Exception
|
|||
const COLLECTION_NOT_FOUND = 'collection_not_found';
|
||||
const COLLECTION_ALREADY_EXISTS = 'collection_already_exists';
|
||||
const COLLECTION_LIMIT_EXCEEDED = 'collection_limit_exceeded';
|
||||
const COLLECTION_DELETION_FAILED = 'collection_deletion_failed';
|
||||
|
||||
/** Documents */
|
||||
const DOCUMENT_NOT_FOUND = 'document_not_found';
|
||||
|
|
Loading…
Reference in a new issue