Search…
Faults
Faults generated from API requests are .json documents with fault as the object property value. When reading and writing context properties, a path property will usually be available, representing the full property path. A fault may also have children, especially in the case of cortex.invalidArgument.validation, where property validation errors are represented as children, whose path property can be examined to pinpoint the error source.
Here's an example of listing a non-existent object:
Untitled
Response
1
$ mdctl api GET /missing
Copied!
1
{
2
"object": "fault",
3
"name": "error",
4
"code": "kInvalidObject",
5
"errCode": "cortex.invalidArgument.object",
6
"status": 400,
7
"message": "Invalid or unknown object.",
8
"path": "missing"
9
}
Copied!
There are two faults, cortex.success.newLocation and cortex.accepted.mediaNotReady, whose HTTP statuses are in the 2XX range. In these cases, clients must handle a seemingly successful response as a fault.
Some faults may also have child faults represented as a faults array. For example, most validation errors (cortex.invalidArgument.validation) contains child faults so clients can pinpoint the source of each error.
Last modified 1mo ago
Copy link