Skip to content

Commit 37118f9

Browse files
committed
Better fix for getting base URL
1 parent c67bca2 commit 37118f9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/error.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export class CertificateError extends Error {
4040

4141
// maybeWrap returns a CertificateError if the code is a certificate error
4242
// otherwise it returns the original error.
43-
static async maybeWrap<T>(err: T, address: string | undefined, logger: Logger): Promise<CertificateError | T> {
44-
if (address && axios.isAxiosError(err)) {
43+
static async maybeWrap<T>(err: T, address: string, logger: Logger): Promise<CertificateError | T> {
44+
if (axios.isAxiosError(err)) {
4545
switch (err.code) {
4646
case X509_ERR_CODE.UNABLE_TO_VERIFY_LEAF_SIGNATURE:
4747
// "Unable to verify" can mean different things so we will attempt to

src/extension.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
4646
axios.interceptors.response.use(
4747
(r) => r,
4848
async (err) => {
49-
throw await CertificateError.maybeWrap(err, err?.config?.baseURL, storage)
49+
throw await CertificateError.maybeWrap(err, axios.getUri(err.config), storage)
5050
},
5151
)
5252

0 commit comments

Comments
 (0)