diff --git a/src/error-handler.ts b/src/error-handler.ts index dbbfcc6..a287bd2 100644 --- a/src/error-handler.ts +++ b/src/error-handler.ts @@ -3,8 +3,13 @@ import * as vscode from 'vscode'; export async function handleError(errorTitle: string, error: any): Promise { let errorDetails = ''; if (error?.response?.body) { - for (const [p, val] of Object.entries(error?.response?.body)) { - errorDetails += `${p}: ${val}\n`; + + if (typeof error?.response?.body == "string") { + errorDetails = error?.response?.body; + } else { + for (const [p, val] of Object.entries(error?.response?.body)) { + errorDetails += `${p}: ${val}\n`; + } } }