-
Notifications
You must be signed in to change notification settings - Fork 0
Errors shown on UI
Ivan Shishkin edited this page Sep 25, 2023
·
3 revisions
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
- File
- Project
- Refresh token
- Role
- Task column
- Task
- Task type
- User
- AUTH
- PROJECT
- ROLE
- entity: string
- fieldName: string
- value: string
- expected: string
- actual: string
Usually it's used for entity - when entity not found.
{
"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"
}
}
Now this error code is used only when registering a user. If entity already exists in database, this error occurs
{
"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
Wrong password
{
"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
}
}
For example, project name can't be null
{
"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]"
}
}
{
"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"
}
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"
}
}