Skip to content

Commit bcc5372

Browse files
vdberghppigazzini
authored andcommitted
Remove superfluous try/catch block.
The exception is already caught by the caller.
1 parent 46ba85b commit bcc5372

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

server/fishtest/templates/tests_view.mak

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -645,26 +645,17 @@
645645
}
646646

647647
const fetchDiffThreeDots = async (diffApiUrl) => {
648-
try {
649-
const token = localStorage.getItem("github_token");
650-
const options = token
651-
? {
652-
headers: {
653-
Authorization: "Bearer " + token,
654-
Accept: "application/vnd.github.diff",
655-
},
656-
}
657-
: {
658-
headers: {
659-
Accept: "application/vnd.github.diff",
660-
},
661-
};
662-
const text = await fetchText(diffApiUrl, options);
663-
return {text: text, count: text?.split("\n")?.length || 0};
664-
} catch(e) {
665-
console.log("Error fetching diff: " + e);
666-
return {text: "", count: 0};
648+
const token = localStorage.getItem("github_token");
649+
const options = {
650+
headers: {
651+
Accept: "application/vnd.github.diff",
652+
}
653+
}
654+
if (token) {
655+
headers.Authorization = "Bearer " + token;
667656
}
657+
const text = await fetchText(diffApiUrl, options);
658+
return {text: text, count: text?.split("\n")?.length || 0};
668659
};
669660

670661
function loadingButton() {

0 commit comments

Comments
 (0)