gracefully surface FetchErrors

Signed-off-by: Jamie Klassen <jklassen@vmware.com>
This commit is contained in:
Jamie Klassen
2022-11-30 13:17:40 -05:00
parent fcf8d33014
commit 0ad476a720
5 changed files with 141 additions and 10 deletions
+19 -8
View File
@@ -184,14 +184,7 @@ export type KubernetesErrorTypes =
| 'UNKNOWN_ERROR';
// @public (undocumented)
export interface KubernetesFetchError {
// (undocumented)
errorType: KubernetesErrorTypes;
// (undocumented)
resourcePath?: string;
// (undocumented)
statusCode?: number;
}
export type KubernetesFetchError = StatusError | RawFetchError;
// @public (undocumented)
export interface KubernetesRequestAuth {
@@ -241,6 +234,14 @@ export interface PodStatusFetchResponse {
type: 'podstatus';
}
// @public (undocumented)
export interface RawFetchError {
// (undocumented)
errorType: 'FETCH_ERROR';
// (undocumented)
message: string;
}
// @public (undocumented)
export interface ReplicaSetsFetchResponse {
// (undocumented)
@@ -265,6 +266,16 @@ export interface StatefulSetsFetchResponse {
type: 'statefulsets';
}
// @public (undocumented)
export interface StatusError {
// (undocumented)
errorType: KubernetesErrorTypes;
// (undocumented)
resourcePath?: string;
// (undocumented)
statusCode?: number;
}
// @public (undocumented)
export interface WorkloadsByEntityRequest {
// (undocumented)
+10 -1
View File
@@ -223,12 +223,21 @@ export interface PodStatusFetchResponse {
}
/** @public */
export interface KubernetesFetchError {
export type KubernetesFetchError = StatusError | RawFetchError;
/** @public */
export interface StatusError {
errorType: KubernetesErrorTypes;
statusCode?: number;
resourcePath?: string;
}
/** @public */
export interface RawFetchError {
errorType: 'FETCH_ERROR';
message: string;
}
/** @public */
export type KubernetesErrorTypes =
| 'BAD_REQUEST'