mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
[json] improved error message
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user