ryanluker / vscode-coverage-gutters

Display test coverage generated by lcov and xml - works with many languages
https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters
MIT License
460 stars 88 forks source link

Prevent coverage parsing exceptions from being sent to sentry #308

Closed ryanluker closed 3 years ago

ryanluker commented 3 years ago

Description

Remove coverage parsing errors from sentry. Currently these errors show up whenever a coverage file is not valid for a parser, there is nothing from an extension standpoint we can do (other then showing the user the error).

Triage

Probably need to prevent the handle error from firing the sentry code in some scenarios 🤔 https://github.com/ryanluker/vscode-coverage-gutters/blob/master/src/files/coverageparser.ts#L151-L166

    private handleError(system: string, error: Error) {
        const message = error.message ? error.message : error;
        const stackTrace = error.stack;
        this.outputChannel.appendLine(
            `[${Date.now()}][coverageparser][${system}]: Error: ${message}`,
        );
        if (stackTrace) {
            this.outputChannel.appendLine(
                `[${Date.now()}][coverageparser][${system}]: Stacktrace: ${stackTrace}`,
            );
        }
        if (this.crashReporter.checkEnabled()) {
            const [ sentryId, sentryPrompt ] = this.crashReporter.captureError(error);
            this.outputChannel.appendLine(`[${Date.now()}][coverageparser][${system}]: ${sentryPrompt} ${sentryId}`);
        }
    }

Work