Skip to content

Commit

Permalink
Undo removing sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
spalmurray-codecov committed Nov 19, 2024
1 parent e0a0272 commit 86f11a6
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/content/github/file/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import {
getBranchReport,
} from "../common/fetchers";
import { print } from "src/utils";
import { isFileUrl } from "../common/utils";
import Sentry from "../../common/sentry";
import { isFileUrl } from "../common/utils";

const globals: {
coverageReport?: FileCoverageReport;
Expand All @@ -60,21 +60,21 @@ function init(): Promise<void> {
}

async function main(): Promise<void> {
const urlMetadata = getMetadataFromURL();
if (!urlMetadata) {
print("file not detected at current URL");
return;
try {
const urlMetadata = getMetadataFromURL();
if (!urlMetadata) {
print("file not detected at current URL");
return;
}
globals.coverageButton = createCoverageButton();
process(urlMetadata);
} catch (e) {
Sentry.captureException(e);
throw e;
}

globals.coverageButton = createCoverageButton();

process(urlMetadata).catch((e) => {
print("unexpected error", e);
updateButton("Coverage: ⚠");
});
}

function getMetadataFromURL(): { [key: string]: string } | null {
function getMetadataFromURL(): FileMetadata | null {
const regexp =
/\/(?<owner>.+?)\/(?<repo>.+?)\/blob\/(?<branch>.+?)\/(?<path>.+?)$/;
const matches = regexp.exec(window.location.pathname);
Expand Down

0 comments on commit 86f11a6

Please sign in to comment.