Skip to content

Commit cee8439

Browse files
author
Tim Etchells
committed
Better error messages from failed requests
1 parent a906f27 commit cee8439

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dev/src/microclimate/project/Requester.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ namespace Requester {
170170

171171
// If the server provided a specific message, present the user with that,
172172
// otherwise show them the whole error (but it will be ugly)
173-
const errMsg = err.error ? err.error : err;
173+
// err.error.msg, then err.error, then the whole err
174+
const errMsg: string = err.error ? (err.error.msg ? err.error.msg : err.error) : JSON.stringify(err);
174175
vscode.window.showErrorMessage(
175176
Translator.t(STRING_NS, "requestFail",
176177
{ operationName: userOperationName, projectName: project.name, err: errMsg })

0 commit comments

Comments
 (0)