-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds new SavedObjectsRespository error type for 404 that do not origi…
…nate from Elasticsearch responses (#107301) Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
fa47c33
commit cdf90aa
Showing
10 changed files
with
248 additions
and
38 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...core-server.savedobjectserrorhelpers.creategenericnotfoundesunavailableerror.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md) > [createGenericNotFoundEsUnavailableError](./kibana-plugin-core-server.savedobjectserrorhelpers.creategenericnotfoundesunavailableerror.md) | ||
|
||
## SavedObjectsErrorHelpers.createGenericNotFoundEsUnavailableError() method | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
static createGenericNotFoundEsUnavailableError(type: string, id: string): DecoratedError; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| type | <code>string</code> | | | ||
| id | <code>string</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`DecoratedError` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/core/server/elasticsearch/supported_server_response_check.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
export const PRODUCT_RESPONSE_HEADER = 'x-elastic-product'; | ||
/** | ||
* Response headers check to determine if the response is from Elasticsearch | ||
* @param headers Response headers | ||
* @returns boolean | ||
*/ | ||
// This check belongs to the elasticsearch service as a dedicated helper method. | ||
export const isSupportedEsServer = (headers: Record<string, string> | null) => { | ||
return !!headers && headers[PRODUCT_RESPONSE_HEADER] === 'Elasticsearch'; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.