Skip to content

Commit caf0c63

Browse files
delvedorswallez
andauthoredOct 20, 2021
Update ErrorResponseBase (#923)
Co-authored-by: Sylvain Wallez <sylvain@elastic.co>
1 parent 685df38 commit caf0c63

File tree

3 files changed

+6
-33
lines changed

3 files changed

+6
-33
lines changed
 

‎output/schema/schema.json

+1-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎output/typescript/types.ts

+1-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎specification/_types/Base.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,13 @@ export class ElasticsearchVersionInfo {
7171
* The response returned by Elasticsearch when request execution did not succeed.
7272
*/
7373
export class ErrorResponseBase {
74-
error: TopLevelError
74+
// In some edge cases `error` can be a string that is a shortcut to `error.reason`, for example if you call `GET _cat/foo`.
75+
// If the error is a string, it means that it was not caused by an exception on ES side, but on the HTTP routing layer.
76+
// This should never happen in clients, because we assume we will never send malformed request.
77+
error: ErrorCause
7578
status: integer
7679
}
7780

78-
/**
79-
* @shortcut_property reason
80-
*/
81-
// Shortcut property needed to handle cases where the error is not caused by an exception. They happen only when the
82-
// HTTP routing layer rejects the request, and thus only at the top level. Example: "GET _cat/foo".
83-
export class TopLevelError extends ErrorCause {}
84-
8581
export class IndicesResponseBase extends AcknowledgedResponseBase {
8682
_shards?: ShardStatistics
8783
}

0 commit comments

Comments
 (0)
Please sign in to comment.