mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
[json] improved error message
This commit is contained in:
parent
aca78bdcf2
commit
7887f81b80
|
@ -168,7 +168,11 @@ export function activate(context: ExtensionContext) {
|
|||
return xhr({ url: uriPath, followRedirects: 5, headers }).then(response => {
|
||||
return response.responseText;
|
||||
}, (error: XHRResponse) => {
|
||||
return Promise.reject(new ResponseError(error.status, error.responseText || getErrorStatusDescription(error.status) || error.toString()));
|
||||
let extraInfo = error.responseText || error.toString();
|
||||
if (extraInfo.length > 256) {
|
||||
extraInfo = `${extraInfo.substr(0, 256)}...`;
|
||||
}
|
||||
return Promise.reject(new ResponseError(error.status, getErrorStatusDescription(error.status) + '\n' + extraInfo));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
"dependencies": {
|
||||
"jsonc-parser": "^2.2.0",
|
||||
"request-light": "^0.2.5",
|
||||
"vscode-json-languageservice": "^3.4.1",
|
||||
"vscode-json-languageservice": "^3.4.3",
|
||||
"vscode-languageserver": "^6.0.0-next.1",
|
||||
"vscode-uri": "^2.0.3"
|
||||
"vscode-uri": "^2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mocha": "2.2.33",
|
||||
|
|
Loading…
Reference in a new issue