mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 17:52:34 -05:00
Improving error message when projects fail to load (#22786)
* Improving message when project fails to load * Cleaning up string
This commit is contained in:
@@ -91,3 +91,12 @@ export async function showInfoMessageWithLearnMoreLink(message: string, link: st
|
||||
void vscode.env.openExternal(vscode.Uri.parse(link));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Consolidates on the error message string
|
||||
*/
|
||||
export function getErrorMessage(error: any): string {
|
||||
return (error instanceof Error)
|
||||
? (typeof error.message === 'string' ? error.message : '')
|
||||
: typeof error === 'string' ? error : `${JSON.stringify(error, undefined, '\t')}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user