From e7be9ac40a66063da81b4ec2b9525210ec2cdafb Mon Sep 17 00:00:00 2001 From: divolgin Date: Fri, 29 Oct 2021 16:19:06 +0000 Subject: [PATCH] Show license expired error when sharing bundles --- pkg/handlers/troubleshoot.go | 2 +- web/src/components/troubleshoot/SupportBundleAnalysis.jsx | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/handlers/troubleshoot.go b/pkg/handlers/troubleshoot.go index 2c9d558e35..e81a46b227 100644 --- a/pkg/handlers/troubleshoot.go +++ b/pkg/handlers/troubleshoot.go @@ -401,7 +401,7 @@ func (h *Handler) ShareSupportBundle(w http.ResponseWriter, r *http.Request) { } else { logger.Errorf("Failed to share support bundle: %d", resp.StatusCode) } - JSON(w, http.StatusInternalServerError, nil) + JSON(w, http.StatusInternalServerError, string(body)) return } diff --git a/web/src/components/troubleshoot/SupportBundleAnalysis.jsx b/web/src/components/troubleshoot/SupportBundleAnalysis.jsx index 2b023bf597..a036aa3421 100644 --- a/web/src/components/troubleshoot/SupportBundleAnalysis.jsx +++ b/web/src/components/troubleshoot/SupportBundleAnalysis.jsx @@ -45,7 +45,12 @@ export class SupportBundleAnalysis extends React.Component { }) .then(async (result) => { if (!result.ok) { - this.setState({ sendingBundle: false, sendingBundleErrMsg: `Unable to send bundle to vendor: Status ${result.status}, please try again.` }); + const text = await result.text(); + let msg = `Unable to send bundle to vendor: Status ${result.status}, please try again.`; + if (text) { + msg = `Unable to send bundle to vendor: ${text}`; + } + this.setState({ sendingBundle: false, sendingBundleErrMsg: msg }); return; } await this.getSupportBundle();