GError
Description
A GError
is a document describing an error during an API call or other Globus
DataSearch operation.
Field Name | Required? | Rules | Description |
---|---|---|---|
@datatype |
False |
must be "GError" if present |
|
@version |
False |
must be "2017-09-01" if present |
|
message |
True |
must be a string |
Descriptive error text. In some cases, this is acceptable to display directly to a user |
code |
True |
must be a string |
A short universal identifier for the type of error, suitable for programmatic
dispatch.
More specific than |
status |
False |
must be an integer |
This is a numeric response code indicating the class of error which occurred.
When the |
error_data |
False |
must not be null if present |
An arbitrary JSON object or array, encoding detailed data about the error.
For example, if multiple errors occurred, this may be an array of more GError
documents.
The format(s) of |
Examples
{
"@datatype": "GError",
"@version": "2017-09-01",
"code": "BadRequest.Generic",
"message": "/v1/ingest requires a JSON payload",
"status": 400
}
{
"@datatype": "GError",
"@version": "2017-09-01",
"code": "BadRequest.Generic",
"message": "/v1/ingest requires a JSON payload",
"status": 400,
"error_data": {
"cause": "Either the data was not JSON formatted, or it is missing a
Content-Type header of 'application/json'",
"recommended_resolution": "Retry with Content-Type set, and check that the
payload is valid JSON"
}
}
{
"@datatype": "GError",
"@version": "2017-09-01",
"code": "AccessForbidden.NeedsOwner",
"message": "The operation you have requested requires \"Owner\" rights",
"status": 403,
"error_data": [
{
"code": "AccessForbidden.NeedsOwner",
"message": "You are not permitted to FOO a BAR which you do not own",
},
{
"code": "AccessForbidden.NeedsOwner.CouldNotClaim",
"message": "This BAR already has an owner, you cannot claim ownership",
}
]
}
error_data
array contains Partial GError
documents. To be complete they would have to include at least @version