未验证 提交 bf15dfdf 编写于 作者: M Matt Bierner 提交者: GitHub

Merge pull request #78991 from amcasey/ShortenTelemetry

Strip a path list out of an error message
......@@ -40,7 +40,16 @@ export class TypeScriptServerError extends Error {
if (errorText) {
const errorPrefix = 'Error processing request. ';
if (errorText.startsWith(errorPrefix)) {
const prefixFreeErrorText = errorText.substr(errorPrefix.length);
let prefixFreeErrorText = errorText.substr(errorPrefix.length);
// Prior to https://github.com/microsoft/TypeScript/pull/32785, this error
// returned and excessively long and detailed list of paths. Since server-side
// filtering doesn't have sufficient granularity to drop these specific
// messages, we sanitize them here.
if (prefixFreeErrorText.indexOf('Could not find sourceFile') >= 0) {
prefixFreeErrorText = prefixFreeErrorText.replace(/ in \[[^\]]*\]/g, '');
}
const newlineIndex = prefixFreeErrorText.indexOf('\n');
if (newlineIndex >= 0) {
// Newline expected between message and stack.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册