Errors
Let's validate...
GoSpeech API uses problem detailsRFC 7807 to describe HTTP errors. A common error will look like this:
HTTP/1.1 403 Forbidden
Content-Type: application/problem+json
Content-Language: en
{
"type": "https://example.com/probs/out-of-credit",
"title": "You do not have enough credit.",
"detail": "Your current balance is 30, but that costs 50.",
"instance": "/account/12345/msgs/abc",
"balance": 30,
"accounts": ["/account/12345", "/account/67890"]
}
A problem details object can have the following attributes:
"type" (string)
- a URI reference that identifies the problem type."title" (string)
- a short, human-readable summary of the problem type."status" (number)
- the HTTP status code for this occurrence of the problem."detail" (string)
- a human-readable explanation that relates to the occurrence of the problem."instance" (string)
- a URI reference that identifies the specific occurrence of the problem.
Problem type definitions MAY extend the problem details object with additional attributes. For instance, our "out of credit"
problem above defines two such extensions -- "balance"
and "accounts"
to provide additional, problem-specific information.
Clients consuming problem details MUST ignore any extensions that they´re not aware of; this allows problem types to evolve and include additional information in the future.
Standard Problem Types
Type | Description | Extensions | Status |
---|---|---|---|
https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1 | Bad Request | - | 400 |
https://www.rfc-editor.org/rfc/rfc7231#section-6.5.4 | Not Found | - | 404 |
https://www.rfc-editor.org/rfc/rfc7231#section-6.5.6 | Not Acceptable | - | 406 |
https://www.rfc-editor.org/rfc/rfc7232#section-4.2 | Precondition Failed | - | 412 |
https://www.rfc-editor.org/rfc/rfc7231#section-6.6.1 | Internal Server Error | - | 500 |
GoSpeech Problem Types
Type | Description | Extensions | Status |
---|---|---|---|
https://docs.gospeech.com/docs/validation-error | Validation Error | errors, errorCodes | 400 |
https://docs.gospeech.com/docs/invalid-record-status | Invalid record status | - | 400 |
NoteLearn more about possible error codes during the upload of a file on Verify the possibility to upload a specific file.
Updated 7 months ago