1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00

Updated error message

This commit is contained in:
Eldad Fux 2020-08-30 07:49:24 +03:00
parent 230a00a1ed
commit 79ee6c04e8

View file

@ -66,7 +66,7 @@ App::post('/v1/database/collections')
'rules' => $parsedRules,
]);
} catch (AuthorizationException $exception) {
throw new Exception('Unauthorized action', 401);
throw new Exception('Unauthorized permissions', 401);
} catch (StructureException $exception) {
throw new Exception('Bad structure. '.$exception->getMessage(), 400);
} catch (\Exception $exception) {
@ -266,7 +266,7 @@ App::put('/v1/database/collections/:collectionId')
'rules' => $parsedRules,
]));
} catch (AuthorizationException $exception) {
throw new Exception('Unauthorized action', 401);
throw new Exception('Unauthorized permissions', 401);
} catch (StructureException $exception) {
throw new Exception('Bad structure. '.$exception->getMessage(), 400);
} catch (\Exception $exception) {
@ -404,7 +404,7 @@ App::post('/v1/database/collections/:collectionId/documents')
$authorization = new Authorization($parentDocument, 'write');
if (!$authorization->isValid($new->getPermissions())) {
throw new Exception('Unauthorized action', 401);
throw new Exception('Unauthorized permissions', 401);
}
$parentDocument
@ -429,7 +429,7 @@ App::post('/v1/database/collections/:collectionId/documents')
try {
$data = $projectDB->createDocument($data);
} catch (AuthorizationException $exception) {
throw new Exception('Unauthorized action', 401);
throw new Exception('Unauthorized permissions', 401);
} catch (StructureException $exception) {
throw new Exception('Bad structure. '.$exception->getMessage(), 400);
} catch (\Exception $exception) {
@ -624,7 +624,7 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId')
try {
$data = $projectDB->updateDocument($data);
} catch (AuthorizationException $exception) {
throw new Exception('Unauthorized action', 401);
throw new Exception('Unauthorized permissions', 401);
} catch (StructureException $exception) {
throw new Exception('Bad structure. '.$exception->getMessage(), 400);
} catch (\Exception $exception) {
@ -680,7 +680,7 @@ App::delete('/v1/database/collections/:collectionId/documents/:documentId')
try {
$projectDB->deleteDocument($documentId);
} catch (AuthorizationException $exception) {
throw new Exception('Unauthorized action', 401);
throw new Exception('Unauthorized permissions', 401);
} catch (StructureException $exception) {
throw new Exception('Bad structure. '.$exception->getMessage(), 400);
} catch (\Exception $exception) {