Merge pull request #4236 from adamdmharvey/k8s-error-reporting
kubernetes: Improve error reporting for plugin misconfiguration
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-kubernetes': patch
|
||||
---
|
||||
|
||||
Improve error reporting for plugin misconfiguration.
|
||||
@@ -129,6 +129,7 @@ microsite
|
||||
middleware
|
||||
minikube
|
||||
Minikube
|
||||
misconfiguration
|
||||
misgendering
|
||||
mkdocs
|
||||
Mkdocs
|
||||
|
||||
@@ -43,7 +43,15 @@ export class KubernetesBackendClient implements KubernetesApi {
|
||||
|
||||
if (!response.ok) {
|
||||
const payload = await response.text();
|
||||
const message = `Request failed with ${response.status} ${response.statusText}, ${payload}`;
|
||||
let message;
|
||||
switch (response.status) {
|
||||
case 404:
|
||||
message =
|
||||
'Could not find the Kubernetes Backend (HTTP 404). Make sure the plugin has been fully installed.';
|
||||
break;
|
||||
default:
|
||||
message = `Request failed with ${response.status} ${response.statusText}, ${payload}`;
|
||||
}
|
||||
throw new Error(message);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user