Error responses
June 2, 2024 ยท View on GitHub
Error responses contain an error property which is a standard
RFC 7807 object with the following
properties:
type{string}: error typetitle{string}: short descriptiondescription{string}: detailed descriptionstatus{string}:CLIENT_ERRORorSERVER_ERRORinstance{string}: URL path that was called- additional properties might be present, depending on the error type. See below for the list of additional properties for each error type.
metadata.info includes the same information as the
log parameter, providing
debugging information about the request.
{
"error": {
"type": "NOT_FOUND",
"title": "Some database models could not be found, e.g. the ids were invalid",
"description": "The 'users' model with 'id' '20' could not be found",
"status": "CLIENT_ERROR",
"instance": "/rest/users/"
},
"metadata": {
"requestid": "56ca9a87-73cc-48db-95fa-ec62e2dee812",
"duration": 15,
"info": {
"timestamp": "2017-12-05T17:05:45.806Z",
"protocol": "http",
"ip": "127.0.0.1",
"origin": "http://localhost:5001",
"path": "/rest/users/",
"method": "PUT",
"status": "CLIENT_ERROR",
"queryvars": {},
"headers": {},
"format": "json",
"charset": "utf-8",
"compress": "identity,identity",
"payload": [{ "id": "20" }, { "id": "21" }],
"payloadsize": 105,
"payloadcount": 2,
"rpc": "rest",
"args": {
"data": [
{ "id": "20", "name": "Anthony" },
{ "id": "21", "name": "David" }
]
},
"params": {},
"datasize": 105,
"datacount": 2,
"summary": "users{location}",
"commandpaths": ["", "location"],
"commandpath": "",
"collections": ["users", "geolocation"],
"collection": "users",
"command": "upsert",
"responsedata": {},
"responsedatasize": 170,
"responsetype": "error"
}
}
}
Error types
Each error response has an associated type. Each error type has a specific title, HTTP status code, JSON-RPC error code and optionally some error-specific additional properties.
VALIDATION: the request syntax or semantics is invalid.ABORTED: the request was aborted.AUTHORIZATION: the request is not authorized, i.e. not allowed to be performed.ROUTE: the URL or route is invalid.NOT_FOUND: some database models could not be found, e.g. theids were invalid.METHOD: the protocol method is unknown or invalid.COMMAND: the command name is unknown or invalid.RESPONSE_NEGOTIATION: the response could not be serialized or content negotiation failed.TIMEOUT: the request took too much time to process.CONFLICT: another client updated the same model, resulting in a conflict.NO_CONTENT_LENGTH: the request payload's length must be specified.PAYLOAD_LIMIT: the request payload is too big.URL_LIMIT: the URL is too big.REQUEST_NEGOTIATION: the request payload could not be loaded, parsed or content negotiation failed.
CONFIG_VALIDATION: wrong configuration caught during server startup.CONFIG_RUNTIME: wrong configuration caught runtime.FORMAT: internal error related to a specific format adapter.CHARSET: internal error related to a specific charset adapter.PROTOCOL: internal error related to a specific protocol adapter.RPC: internal error related to a specific rpc adapter.DATABASE: internal error related to a specific database adapter.LOG: internal error related to a specific log provider.COMPRESS: internal error related to a specific compress adapter.PLUGIN: internal error related to a specific plugin.ENGINE: internal engine error.UNKNOWN: internal uncaught error.
Client-side errors
VALIDATION
The request syntax or semantics is invalid.
HTTP status code: 400
JSON-RPC error code: -32602
- kind
{string}: kind of validation errors. Can be:feature: the collection does not support a specific feature used in the requestprotocol: syntax error related to the protocolrpc: syntax error related to the RPC systemargument: syntax error related to one argumentdata: syntax error related to thedataargumentconstraint: thedataargument does not validate against some constraint
- path 'VARR'
- value VAL
- model OBJ
- suggestions VAL_ARR
{
"type": "VALIDATION",
"title": "The request syntax or semantics is invalid",
"description": "",
"status": "CLIENT_ERROR",
"instance": "/rest/users/"
}
ABORTED
The request was aborted.
HTTP status code: 400
JSON-RPC error code: -32600
{
"type": "ABORTED",
"title": "The request was aborted",
"description": "The HTTP request was aborted by the client while the server was reading its payload",
"status": "CLIENT_ERROR",
"instance": "/rest/users/"
}
AUTHORIZATION
The request is not authorized, i.e. not allowed to be performed.
HTTP status code: 403
- collection
{string} - ids
{string[]}: modelsids
{
"type": "AUTHORIZATION",
"title": "The request is not authorized, i.e. not allowed to be performed",
"description": "The 'users' model with 'id' '10' cannot be searched",
"status": "CLIENT_ERROR",
"instance": "/rest/users/10",
"collection": "users",
"ids": ["10"]
}
ROUTE
The URL or route is invalid.
HTTP status code: 404
JSON-RPC error code: -32601
- suggestions VAL_ARR
{
"type": "ROUTE",
"title": "The URL or route is invalid",
"description": "",
"status": "CLIENT_ERROR",
"instance": "/rest/users/"
}
NOT_FOUND
Some database models could not be found, e.g. the ids were invalid.
HTTP status code: 404
- collection
{string} - ids
{string[]}: modelsids
{
"type": "NOT_FOUND",
"title": "Some database models could not be found, e.g. the ids were invalid",
"description": "The 'users' model with 'id' '20' could not be found",
"status": "CLIENT_ERROR",
"instance": "/rest/users/20",
"collection": "users",
"ids": ["20"]
}
METHOD
The protocol method is unknown or invalid.
HTTP status code: 405
JSON-RPC error code: -32601
- suggestions STR_ARR
{
"type": "METHOD",
"title": "The protocol method is unknown or invalid",
"description": "",
"status": "CLIENT_ERROR",
"instance": "/rest/users/"
}
COMMAND
The command name is unknown or invalid.
HTTP status code: 405
JSON-RPC error code: -32601
- suggestions STR_ARR
{
"type": "COMMAND",
"title": "The command name is unknown or invalid",
"description": "",
"status": "CLIENT_ERROR",
"instance": "/rest/users/"
}
RESPONSE_NEGOTIATION
The response could not be serialized or content negotiation failed.
HTTP status code: 406
JSON-RPC error code: -32600
- kind 'compress|charset|format'
- suggestions VAL_ARR
{
"type": "RESPONSE_NEGOTIATION",
"title": "The response could not be serialized or content negotiation failed",
"description": "",
"status": "CLIENT_ERROR",
"instance": "/rest/users/"
}
TIMEOUT
The request took too much time to process.
HTTP status code: 408
- limit NUM
{
"type": "TIMEOUT",
"title": "The request took too much time to process",
"description": "",
"status": "CLIENT_ERROR",
"instance": "/rest/users/"
}
CONFLICT
Another client updated the same model, resulting in a conflict.
HTTP status code: 409
- collection
{string} - ids
{string[]}: modelsids
{
"type": "CONFLICT",
"title": "Another client updated the same model, resulting in a conflict",
"description": "Those models already exist",
"status": "CLIENT_ERROR",
"instance": "/rest/users/",
"collection": "users",
"ids": ["9"]
}
NO_CONTENT_LENGTH
The request payload's length must be specified.
HTTP status code: 411
JSON-RPC error code: -32600
{
"type": "NO_CONTENT_LENGTH",
"title": "The request payload's length must be specified",
"description": "",
"status": "CLIENT_ERROR",
"instance": "/rest/users/"
}
PAYLOAD_LIMIT
The request payload is too big.
HTTP status code: 413
JSON-RPC error code: -32600
- kind 'size|models|commands|depth'
- value NUM
- limit NUM
{
"type": "PAYLOAD_LIMIT",
"title": "The request payload is too big",
"description": "",
"status": "CLIENT_ERROR",
"instance": "/rest/users/"
}
URL_LIMIT
The URL is too big.
HTTP status code: 414
JSON-RPC error code: -32600
- value NUM
- limit NUM
{
"type": "URL_LIMIT",
"title": "The URL is too big",
"description": "",
"status": "CLIENT_ERROR",
"instance": "/rest/users/"
}
REQUEST_NEGOTIATION
The request payload could not be loaded, parsed or content negotiation failed.
HTTP status code: 415
JSON-RPC error code: -32700
- kind 'parse|compress|charset|format'
- suggestions VAL_ARR
{
"type": "REQUEST_NEGOTIATION",
"title": "The request payload could not be loaded, parsed or content negotiation failed",
"description": "",
"status": "CLIENT_ERROR",
"instance": "/rest/users/"
}
Server-side errors
CONFIG_VALIDATION
Wrong configuration caught during server startup.
HTTP status code: none. It is thrown during server startup.
JSON-RPC error code: -32603
- path
{string}: path to the invalid configuration key. Example:protocols.http.port. - value
{any}: value of the invalid configuration key. Example:-80. - suggestions
{any[]}: suggestions of possible valid values for the configuration key. Example:[80].
{
"type": "CONFIG_VALIDATION",
"title": "Wrong configuration caught during server startup",
"description": "Wrong configuration: in 'protocols.http', port must be greater than or equal to 0",
"status": "SERVER_ERROR"
}
CONFIG_RUNTIME
Wrong configuration caught runtime.
HTTP status code: 500
JSON-RPC error code: -32603
- path 'VARR'
- value VAL
- suggestions VAL_ARR
{
"type": "CONFIG_RUNTIME",
"title": "Wrong configuration caught runtime",
"description": "",
"status": "SERVER_ERROR",
"instance": "/rest/users/"
}
FORMAT
Internal error related to a specific format adapter.
HTTP status code: 500
JSON-RPC error code: -32603
- adapter
{string}: format
{
"type": "FORMAT",
"title": "Internal error related to a specific format adapter",
"description": "In the adapter 'json', could not parse content",
"status": "SERVER_ERROR",
"instance": "/rest/users/",
"adapter": "json"
}
CHARSET
Internal error related to a specific charset adapter.
HTTP status code: 500
JSON-RPC error code: -32603
- adapter
{string}: charset
{
"type": "CHARSET",
"title": "Internal error related to a specific charset adapter",
"description": "In the adapter 'utf-8', could not decode bytes",
"status": "SERVER_ERROR",
"instance": "/rest/users/",
"adapter": "utf-8"
}
PROTOCOL
Internal error related to a specific protocol adapter.
HTTP status code: 500
JSON-RPC error code: -32603
- adapter
{string}: protocol name
{
"type": "PROTOCOL",
"title": "Internal error related to a specific protocol adapter",
"description": "In the adapter 'http', load is not defined",
"status": "SERVER_ERROR",
"instance": "/rest/users/",
"adapter": "http"
}
RPC
Internal error related to a specific rpc adapter.
HTTP status code: 500
JSON-RPC error code: -32603
- adapter
{string}: rpc name.
{
"type": "RPC",
"title": "Internal error related to a specific rpc adapter",
"description": "In the adapter 'graphql', parse is not defined",
"status": "SERVER_ERROR",
"instance": "/rest/users/",
"adapter": "graphql"
}
DATABASE
Internal error related to a specific database adapter.
HTTP status code: 500
JSON-RPC error code: -32603
- adapter
{string}: database name
{
"type": "DATABASE",
"title": "Internal error related to a specific database adapter",
"description": "In the adapter 'memory', connection is not defined",
"status": "SERVER_ERROR",
"instance": "/rest/users/",
"adapter": "memory"
}
LOG
Internal error related to a specific log provider.
HTTP status code: 500
JSON-RPC error code: -32603
- adapter
{string}: log provider name
{
"type": "LOG",
"title": "Internal error related to a specific log adapter",
"description": "In the adapter 'http', could not find URL",
"status": "SERVER_ERROR",
"instance": "/rest/users/",
"adapter": "http"
}
COMPRESS
Internal error related to a specific compress adapter.
HTTP status code: 500
JSON-RPC error code: -32603
- adapter
{string}: compression algorithm
{
"type": "COMPRESS",
"title": "Internal error related to a specific compress adapter",
"description": "In the adapter 'gzip', could not read data",
"status": "SERVER_ERROR",
"instance": "/rest/users/",
"adapter": "gzip"
}
PLUGIN
Internal error related to a specific plugin.
HTTP status code: 500
JSON-RPC error code: -32603
- plugin
{string}: plugin name
{
"type": "PLUGIN",
"title": "Internal error related to a specific plugin",
"description": "In the plugin 'testPlugin', optA is not defined",
"status": "SERVER_ERROR",
"plugin": "testPlugin"
}
ENGINE
Internal engine error.
HTTP status code: 500
JSON-RPC error code: -32603
{
"type": "ENGINE",
"title": "Internal engine error",
"description": "'response.metadata' should be defined",
"status": "SERVER_ERROR",
"instance": "/rest/users/"
}
UNKNOWN
Internal uncaught error.
HTTP status code: 500
JSON-RPC error code: -32603
{
"type": "UNKNOWN",
"title": "Internal uncaught error",
"description": "validate is not defined",
"status": "SERVER_ERROR",
"instance": "/rest/users/"
}