Skip to content

Errors shown on UI

Ivan Shishkin edited this page Sep 25, 2023 · 3 revisions

Error codes

Below are the error codes that will be in the response

Common JSON:

  • status: string
  • message: string
  • statusCode: int
  • errorType: string
  • error: obj
  • timestamp: string

Entities:

  1. File
  2. Project
  3. Refresh token
  4. Role
  5. Task column
  6. Task
  7. Task type
  8. User

Error types:

  1. AUTH
  2. PROJECT
  3. ROLE

AUTH type error obj fields:

  • entity: string
  • fieldName: string
  • value: string

ROLE type error obj fields:

  • expected: string
  • actual: string

NOT_FOUND - 404

Usually it's used for entity - when entity not found.

Example:

{
   "statusCode": 404,
   "status": "NOT_FOUND",
   "errorType": "AUTH",
   "timestamp": "2023-09-24T09:06:36.316+00:00",
   "message": "User with id=4 not found",
   "error": {
       "entity": "User",
       "fieldName": "id",
       "value": "4"
   }
}

ENTITY_ALREADY_EXISTS - 409

Now this error code is used only when registering a user. If entity already exists in database, this error occurs

Example:

{
   "statusCode": 409,
   "status": "ENTITY_ALREADY_EXISTS",
   "errorType": "AUTH",
   "timestamp": "2023-09-24T09:06:36.316+00:00",
   "message": "User with email=some_email@email.com already exists",
   "error": {
       "entity": "User",
       "fieldName": "email",
       "value": "some_email@email.com"
   }
}

List of entities can be found in NOT_FOUND error code description

BAD_CREDENTIALS- 422

Wrong password

Example:

{
   "statusCode": 422,
   "status": "BAD_CREDENTIALS",
   "errorType": "AUTH",
   "timestamp": "2023-09-24T09:06:36.316+00:00",
   "message": "Bad credentials",
   "error": {
       "entity": "User",
       "fieldName": "password",
       "value": null
   }
}

ARGUMENT_NOT_VALID - 422

For example, project name can't be null

Example:

{
   "statusCode": 422,
   "status": "ARGUMENT_NOT_VALID",
   "errorType": "PROJECT",
   "timestamp": "2023-09-24T09:06:36.316+00:00",
   "message": "[Invalid Name: Empty name]",
   "error": {
       "reason": "[Invalid Name: Empty name]"
   }
}

PROJECT_COLUMN - 409

{
   "statusCode": 409,
   "status": "PROJECT_COLUMN",
   "errorType": "PROJECT",
   "timestamp": "2023-09-24T09:06:36.316+00:00",
   "message": "Project with id=3 doesn't contain column with id=4"
}

ROLE_CHECK - 403

In this example, the user is expected to have the MEMBER_PLUS role to perform the action, but they have MEMBER

{
   "statusCode": 403,
   "status": "ROLE_CHECK ",
   "errorType": "ROLE",
   "timestamp": "2023-09-24T09:06:36.316+00:00",
   "message": "Required role for this action is MEMBER_PLUS",
   "error": {
       "expected": "MEMBER_PLUS",
       "actual": "MEMBER"
   }
}