Mrinal Gautam
Mrinal Gautam

Reputation: 1

API Error response message in VS code extensions

What's the standard way for showing error message on failure response from API call, to the user in VS code extension? i.e. it comes from the Server side or it is managed in VS code extension code.

Upvotes: 0

Views: 2269

Answers (1)

Dan Gardner
Dan Gardner

Reputation: 1279

You can show a "Toast" style notification in the bottom right of the VS Code window, you've probably seen them whilst using the editor.

Make your call, and when your logic dictates the calls fails you can call the showErrorMessage function.

vscode.window.showErrorMessage('Error Making API Call');

You can find more info on the method in the Extension Docs

Upvotes: 1

Related Questions