From a3e580158a73a7c4443b6dbf56131f4cd04e36b8 Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 29 Aug 2023 10:00:44 -0800 Subject: [PATCH] Fix "undefined" in error message --- src/commands.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/commands.ts b/src/commands.ts index 14cb6d7a..9f26a78c 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -58,10 +58,6 @@ export class Commands { return undefined }) .catch((err) => { - let message = err - if (axios.isAxiosError(err) && err.response?.data) { - message = err.response.data.detail - } if (err instanceof CertificateError) { err.showNotification() @@ -72,6 +68,8 @@ export class Commands { } // This could be something like the header command erroring or an // invalid session token. + const message = + err?.response?.data?.detail || err?.message || err?.response?.status || "no response from the server" return { message: "Failed to authenticate: " + message, severity: vscode.InputBoxValidationSeverity.Error, pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy