Log error message
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
getOnDiskWorkspaceFolders,
|
||||
getOnDiskWorkspaceFoldersObjects,
|
||||
} from "./workspace-folders";
|
||||
import { getErrorMessage } from "../../pure/helpers-pure";
|
||||
|
||||
interface PathData {
|
||||
path: string;
|
||||
@@ -163,7 +164,9 @@ export abstract class FilePathDiscovery<T extends PathData> extends Discovery {
|
||||
// that's likely to succeed on a retry, so don't bother adding it back
|
||||
// to the changedFilePaths set.
|
||||
void extLogger.log(
|
||||
`${this.name} failed while processing path: ${path}`,
|
||||
`${
|
||||
this.name
|
||||
} failed while processing path "${path}": ${getErrorMessage(e)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import { mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
||||
import * as tmp from "tmp";
|
||||
import { normalizePath } from "../../../../../src/pure/files";
|
||||
import { extLogger } from "../../../../../src/common/logging/vscode/loggers";
|
||||
import { getErrorMessage } from "../../../../../src/pure/helpers-pure";
|
||||
|
||||
interface TestData {
|
||||
path: string;
|
||||
@@ -385,10 +386,10 @@ describe("FilePathDiscovery", () => {
|
||||
);
|
||||
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
`TestFilePathDiscovery failed while processing path: ${join(
|
||||
`TestFilePathDiscovery failed while processing path "${join(
|
||||
workspacePath,
|
||||
"123.test",
|
||||
)}`,
|
||||
)}": ${getErrorMessage(new Error("error"))}`,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user