Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Inhalt


Table of Contents
minLevel1
maxLevel6
outlinefalse
typelist
printabletrue

Error

Valid status-codes

Code

Description

VALIDATION_ERROR

One or more required fields are missing

One or more fields are not valid

NOT_EXISTING

The object doesn't exist

EXISTING

The object already exists

DB_ERROR

There was an error during the database operation

Examples

Base

Code Block
languagejson
{
  "status": "ERROR",
  "errorcode": "VALIDATION_ERROR",
  "message": "One or more fields are missing or invalid"
}


DB_ERROR

Code Block
languagejson
{
  "status": "ERROR",
  "errorcode": "DB_ERROR",
  "error": "This is the DB_ERROR object from Prisma",
  "message": "There was an error during the database operation. More information in error"
}

Successful operation

Valid status-codes

Code

Description

CREATED

UPDATED

DELETED

Examples

Base

Code Block
languagejson
{
  "status": "DELETED",
  "message": "Successfully deleted entry"
}


CREATED

Code Block
languagejson
{
  "status": "CREATED",
  "message": "Successfully created entry",
  "id": 42
}


UPDATED

Code Block
languagejson
{
  "status": "CREATED",
  "message": "Successfully created entry",
  "id": 42
}