feat: update descriptions of functions errors

This commit is contained in:
Christy Jacob
2022-02-08 03:04:06 +04:00
parent 4934736e2d
commit e7cfa206e5
2 changed files with 6 additions and 3 deletions
+3 -3
View File
@@ -270,21 +270,21 @@ return [
/** Functions */
Exception::FUNCTION_NOT_FOUND => [
'name' => Exception::FUNCTION_NOT_FOUND,
'description' => 'The requested function could not be found.',
'description' => 'Function with the requested ID could not be found.',
'code' => 404,
],
/** Deployments */
Exception::DEPLOYMENT_NOT_FOUND => [
'name' => Exception::DEPLOYMENT_NOT_FOUND,
'description' => 'The requested deployment could not be found.',
'description' => 'Deployment with the requested ID could not be found.',
'code' => 404,
],
/** Executions */
Exception::EXECUTION_NOT_FOUND => [
'name' => Exception::EXECUTION_NOT_FOUND,
'description' => 'The requested execution could not be found.',
'description' => 'Execution with the requested ID could not be found.',
'code' => 404,
],
+3
View File
@@ -554,6 +554,7 @@ App::get('/v1/functions/:functionId/tags')
$cursorTag = $dbForProject->getDocument('tags', $cursor);
if ($cursorTag->isEmpty()) {
// TODO: Shouldn't this be a 404 error ?
throw new Exception("Tag '{$cursor}' for the 'cursor' value not found.", 400, Exception::DEPLOYMENT_NOT_FOUND);
}
}
@@ -807,6 +808,8 @@ App::get('/v1/functions/:functionId/executions')
$cursorExecution = $dbForProject->getDocument('executions', $cursor);
if ($cursorExecution->isEmpty()) {
// TODO: Shouldn't this be a 404 error ?
// Or do we define a new error type GENERAL_CURSOR_NOT_FOUND for these types ?
throw new Exception("Execution '{$cursor}' for the 'cursor' value not found.", 400, Exception::EXECUTION_NOT_FOUND);
}
}