Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit c10832b

Browse files
committed
v3 docs: Specify which errors endpoints might return
- For app creation, document the new `CF-UniquenessError` that may be returned when the app name is already taken - For other common errors, add a new "Common errors" section under "Concepts" > "Errors" that lists their titles and codes. [finishes #173506373] Authored-by: Reid Mitchell <rmitchell@pivotal.io>
1 parent a637d95 commit c10832b

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

docs/v3/source/includes/concepts/_errors.md.erb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,27 @@ Example Error
1717

1818
An error response will always return a list of error objects. Errors appear on the [job resource](#jobs) for asynchronous operations.
1919

20-
#### The error object
20+
### The error object
21+
22+
Clients should use the `code` and `title` fields for programmatically handling specific errors.
23+
The message in the `detail` field is subject to change over time.
2124

2225
Name | Type | Description
2326
---- | ---- | -----------
2427
**code** | _integer_ | A numeric code for this error
2528
**title** | _string_ | Name of the error
2629
**detail** | _string_ | Detailed description of the error
2730

31+
### Common errors
32+
33+
These are some of the more common errors returned by many endpoints.
34+
35+
Title | Code | HTTP Status | Description
36+
----- | ---- | ----------- | -----------
37+
`CF-BadQueryParameter` | 10005 | 400 | An invalid query parameter was given
38+
`CF-InvalidAuthToken` | 1000 | 401 | An invalid auth token was given
39+
`CF-NotAuthenticated` | 10002 | 401 | No auth token was given, but authentication is required for this endpoint
40+
`CF-NotAuthorized` | 10003 | 403 | The authenticated user does not have permission to perform this operation
41+
`CF-ResourceNotFound` | 10010 | 404 | The specified resource does not exist, or the authenticated user cannot read it
42+
`CF-UnprocessableEntity` | 10008 | 422 | Catch-all error when an operation fails to complete; the `detail` field will contain more information
43+
`UnknownError` | 10001 | 500 | An unexpected, uncaught error occurred; the CC logs will contain more information

docs/v3/source/includes/resources/apps/_create.md.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ Name | Type | Description | Default
5151
**metadata.labels** | [_label object_](#labels) | Labels applied to the app
5252
**metadata.annotations** | [_annotation object_](#annotations) | Annotations applied to the app
5353

54+
#### Potential errors
55+
56+
In addition to any [common errors](#common-errors), this endpoint may return the following errors.
57+
58+
Title | Code | HTTP Status | Description
59+
----- | ---- | ----------- | -----------
60+
`CF-UniquenessError` | 10016 | 422 | The given app name is already taken in the targeted space
61+
5462
#### Permitted roles
5563
|
5664
--- | ---

0 commit comments

Comments
 (0)