mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Supply deprecated req and res properties on IHttpFetchError for legacy compatibility (#48430) (#48555)
This commit is contained in:
parent
8ff906ac53
commit
8cc58a9866
6 changed files with 51 additions and 0 deletions
|
@ -16,6 +16,8 @@ export interface IHttpFetchError extends Error
|
|||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [body](./kibana-plugin-public.ihttpfetcherror.body.md) | <code>any</code> | |
|
||||
| [req](./kibana-plugin-public.ihttpfetcherror.req.md) | <code>Request</code> | |
|
||||
| [request](./kibana-plugin-public.ihttpfetcherror.request.md) | <code>Request</code> | |
|
||||
| [res](./kibana-plugin-public.ihttpfetcherror.res.md) | <code>Response</code> | |
|
||||
| [response](./kibana-plugin-public.ihttpfetcherror.response.md) | <code>Response</code> | |
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IHttpFetchError](./kibana-plugin-public.ihttpfetcherror.md) > [req](./kibana-plugin-public.ihttpfetcherror.req.md)
|
||||
|
||||
## IHttpFetchError.req property
|
||||
|
||||
> Warning: This API is now obsolete.
|
||||
>
|
||||
> Provided for legacy compatibility. Prefer the `request` property instead.
|
||||
>
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
readonly req: Request;
|
||||
```
|
|
@ -0,0 +1,16 @@
|
|||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IHttpFetchError](./kibana-plugin-public.ihttpfetcherror.md) > [res](./kibana-plugin-public.ihttpfetcherror.res.md)
|
||||
|
||||
## IHttpFetchError.res property
|
||||
|
||||
> Warning: This API is now obsolete.
|
||||
>
|
||||
> Provided for legacy compatibility. Prefer the `response` property instead.
|
||||
>
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
readonly res?: Response;
|
||||
```
|
|
@ -21,6 +21,9 @@ import { IHttpFetchError } from './types';
|
|||
|
||||
/** @internal */
|
||||
export class HttpFetchError extends Error implements IHttpFetchError {
|
||||
public readonly req: Request;
|
||||
public readonly res?: Response;
|
||||
|
||||
constructor(
|
||||
message: string,
|
||||
public readonly request: Request,
|
||||
|
@ -28,6 +31,8 @@ export class HttpFetchError extends Error implements IHttpFetchError {
|
|||
public readonly body?: any
|
||||
) {
|
||||
super(message);
|
||||
this.req = request;
|
||||
this.res = response;
|
||||
|
||||
// captureStackTrace is only available in the V8 engine, so any browser using
|
||||
// a different JS engine won't have access to this method.
|
||||
|
|
|
@ -236,6 +236,14 @@ export interface HttpResponse {
|
|||
export interface IHttpFetchError extends Error {
|
||||
readonly request: Request;
|
||||
readonly response?: Response;
|
||||
/**
|
||||
* @deprecated Provided for legacy compatibility. Prefer the `request` property instead.
|
||||
*/
|
||||
readonly req: Request;
|
||||
/**
|
||||
* @deprecated Provided for legacy compatibility. Prefer the `response` property instead.
|
||||
*/
|
||||
readonly res?: Response;
|
||||
readonly body?: any;
|
||||
}
|
||||
|
||||
|
|
|
@ -547,8 +547,12 @@ export type IContextProvider<THandler extends HandlerFunction<any>, TContextName
|
|||
export interface IHttpFetchError extends Error {
|
||||
// (undocumented)
|
||||
readonly body?: any;
|
||||
// @deprecated (undocumented)
|
||||
readonly req: Request;
|
||||
// (undocumented)
|
||||
readonly request: Request;
|
||||
// @deprecated (undocumented)
|
||||
readonly res?: Response;
|
||||
// (undocumented)
|
||||
readonly response?: Response;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue