Merge pull request #4236 from adamdmharvey/k8s-error-reporting

kubernetes: Improve error reporting for plugin misconfiguration
This commit is contained in:
Ben Lambert
2021-01-25 12:54:43 +01:00
committed by GitHub
3 changed files with 15 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-kubernetes': patch
---
Improve error reporting for plugin misconfiguration.
+1
View File
@@ -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);
}