fix: catched all errors (#384)

This commit is contained in:
Anurag Hazra authored and GitHub committed 2020-08-13 21:18:26 +05:30
1 parent ec246d27ab
commit 056aaaf189
3 files changed
+12 -12

No files matched your search

+4 -4
View File
@@ -37,9 +37,6 @@ module.exports = async (req, res) => {
parseBoolean(count_private),
parseBoolean(include_all_commits)
);
} catch (err) {
return res.send(renderError(err.message, err.secondaryMessage));
}
const cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
@@ -49,7 +46,7 @@ module.exports = async (req, res) => {
res.setHeader("Cache-Control", `public, max-age=${cacheSeconds}`);
res.send(
return res.send(
renderStatsCard(stats, {
hide: parseArray(hide),
show_icons: parseBoolean(show_icons),
@@ -65,4 +62,7 @@ module.exports = async (req, res) => {
theme,
})
);
} catch (err) {
return res.send(renderError(err.message, err.secondaryMessage));
}
};
+4 -4
View File
@@ -27,9 +27,6 @@ module.exports = async (req, res) => {
try {
repoData = await fetchRepo(username, repo);
} catch (err) {
return res.send(renderError(err.message, err.secondaryMessage));
}
let cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
@@ -52,7 +49,7 @@ module.exports = async (req, res) => {
res.setHeader("Cache-Control", `public, max-age=${cacheSeconds}`);
res.send(
return res.send(
renderRepoCard(repoData, {
title_color,
icon_color,
@@ -62,4 +59,7 @@ module.exports = async (req, res) => {
show_owner: parseBoolean(show_owner),
})
);
} catch (err) {
return res.send(renderError(err.message, err.secondaryMessage));
}
};
+4 -4
View File
@@ -29,9 +29,6 @@ module.exports = async (req, res) => {
try {
topLangs = await fetchTopLanguages(username);
} catch (err) {
return res.send(renderError(err.message, err.secondaryMessage));
}
const cacheSeconds = clampValue(
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
@@ -41,7 +38,7 @@ module.exports = async (req, res) => {
res.setHeader("Cache-Control", `public, max-age=${cacheSeconds}`);
res.send(
return res.send(
renderTopLanguages(topLangs, {
hide_title: parseBoolean(hide_title),
hide_border: parseBoolean(hide_border),
@@ -54,4 +51,7 @@ module.exports = async (req, res) => {
layout,
})
);
} catch (err) {
return res.send(renderError(err.message, err.secondaryMessage));
}
};