Skip to content

Commit

Permalink
Merge pull request #365 from cceckman/issue364
Browse files Browse the repository at this point in the history
Address #364: catch errors per-section
  • Loading branch information
ryanluker authored May 6, 2022
2 parents c2e8909 + 5661360 commit 39ea7f9
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/coverage-system/sectionfinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,22 @@ export class SectionFinder {
* @param section data section to check against filename
* @param editorFileRelative normalized relative path (against workspace folder) of editor filename, starts with ###
* @param workspaceFolderName workspace folder name
* @returns true if this section matches (applies to) the provided editorRelativeFile
*/
private checkSection(section: Section, editorFileRelative: string, workspaceFolderName: string): boolean {
// Check if we need to swap any fragments of the file path with a remote fragment
// IE: /var/www/ -> /home/me/
const sectionFileName = this.resolveFileName(section.file);
if (!isPathAbsolute(sectionFileName)) {
return this.checkSectionRelative(sectionFileName, editorFileRelative);
} else {
return this.checkSectionAbsolute(sectionFileName, editorFileRelative, workspaceFolderName);
try {
// Check if we need to swap any fragments of the file path with a remote fragment
// IE: /var/www/ -> /home/me/
const sectionFileName = this.resolveFileName(section.file);
if (!isPathAbsolute(sectionFileName)) {
return this.checkSectionRelative(sectionFileName, editorFileRelative);
} else {
return this.checkSectionAbsolute(sectionFileName, editorFileRelative, workspaceFolderName);
}
} catch (error) {
const checkSectionError = `[${Date.now()}][renderer]: ignoring section: error from check: ${error}`;
this.outputChannel.appendLine(checkSectionError);
return false;
}
}

Expand Down

0 comments on commit 39ea7f9

Please sign in to comment.