Skip to content

Commit a666619

Browse files
Remove error handling for now
1 parent 6312923 commit a666619

4 files changed

Lines changed: 3 additions & 46 deletions

File tree

extensions/ql-vscode/src/cli.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import * as fs from 'fs-extra';
44
import * as path from 'path';
55
import { parser } from 'stream-json';
66
import { pick } from 'stream-json/filters/Pick';
7-
import { verifier } from 'stream-json/utils/Verifier';
87
import Assembler = require('stream-json/Assembler');
98
import { chain } from 'stream-chain';
109
import * as sarif from 'sarif';
@@ -591,18 +590,14 @@ export class CodeQLCliServer implements Disposable {
591590
fs.createReadStream(interpretedResultsPath),
592591
p,
593592
pick({filter: 'runs.0.results'}),
594-
verifier()
595593
]);
596594

597595
// Creates JavaScript objects from the token stream
598596
const asm = Assembler.connectTo(pipeline);
599597

600598
// Returns a constructed Log object with the results or an empty array if no results were found.
601599
// If the parser fails for any reason, it will reject the promise.
602-
return await new Promise((resolve, reject) => {
603-
pipeline.on('error', (error) => {
604-
reject(error);
605-
});
600+
return await new Promise((resolve) => {
606601

607602
asm.on('done', (asm) => {
608603

extensions/ql-vscode/src/vscode-tests/no-workspace/cli.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ describe.only('cliServerTests', () => {
1414

1515
it('should return an empty array if there are no results', async () => {
1616
const result = await CodeQLCliServer.parseSarif(__dirname + '/data/sarif/emptyResultsSarif.sarif');
17-
expect(result.runs[0].results?.length).to.eq(0);
18-
});
19-
20-
it('should throw an error if the file fails to parse', async () => {
21-
const result = await CodeQLCliServer.parseSarif(__dirname + '/data/sarif/invalidSarif.sarif');
22-
await expect(result).to.rejectedWith(/Error: Parsing output of interpretation failed: /);
17+
expect(result.runs[0].results).to.be.empty;
2318
});
2419
});

extensions/ql-vscode/src/vscode-tests/no-workspace/data/sarif/emptyResultsSarif.sarif

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929
}
3030
],
31-
"results": [],
31+
"results": []
3232
]
3333
}
3434
]

extensions/ql-vscode/src/vscode-tests/no-workspace/data/sarif/invalidSarif.sarif

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)