Log error message

This commit is contained in:
Robert
2023-06-21 08:24:22 +01:00
parent fa773a0029
commit 7135d39aad
2 changed files with 7 additions and 3 deletions

View File

@@ -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)}`,
);
}
}

View File

@@ -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"))}`,
);
});
});