Tray Embedded / Embedded APIs / Intro to the APIs / Errors

Errors

Errors

In case of an error, the response will contain the standard GraphQL error structure, described in the Errors section of the spec:

{
"errors": [
{
"message": "something happened",
"locations": [ { "line": 6, "column": 7 } ],
"path": [ "updateWorkflow" ],
"extensions": {
"name": "PreconditionError",
"code": "resource_does_not_exist"
}
}
]
}

In Tray Partner API, the message and extensions.name fields will always exist. Others depend on the type of the error, explained in the next tab.

Error Types

extensions.name will always contain one of the following values:

GraphQLError - indicates an error related to GraphQL query language or schema. Usually it will be a syntax error in the request or a missing field that it asked for.

PreconditionError - the query could not be realised because of state of the system or query parameters. The field extensions.code will indicate the more detailed reason.

InternalError - an unexpected error in the system. An extensions.errorId field will in this case contain an identifier of the error that can be reported for investigation purposes.

Error Codes

An error code will be provided in case of a PreconditionError.

General:

access_not_allowed - user making the request does not have rights to access a resource as part of the query.
resource_does_not_exist - could not find an object under the given id.

resource_already_exists - cannot create a duplicate object.

Users:

user_does_not_exist - a user under the given id was not found.

user_already_exists - cannot create a user, as some of the unique attributes are already in the system.

Workflows:

workflow_does_not_exist - a workflow under the given id was not found.