mirror of
https://github.com/Aviortheking/codestats-readme.git
synced 2025-04-22 10:42:08 +00:00
fix: catched all errors (#384)
This commit is contained in:
parent
ec246d27ab
commit
056aaaf189
@ -37,9 +37,6 @@ module.exports = async (req, res) => {
|
|||||||
parseBoolean(count_private),
|
parseBoolean(count_private),
|
||||||
parseBoolean(include_all_commits)
|
parseBoolean(include_all_commits)
|
||||||
);
|
);
|
||||||
} catch (err) {
|
|
||||||
return res.send(renderError(err.message, err.secondaryMessage));
|
|
||||||
}
|
|
||||||
|
|
||||||
const cacheSeconds = clampValue(
|
const cacheSeconds = clampValue(
|
||||||
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
|
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.setHeader("Cache-Control", `public, max-age=${cacheSeconds}`);
|
||||||
|
|
||||||
res.send(
|
return res.send(
|
||||||
renderStatsCard(stats, {
|
renderStatsCard(stats, {
|
||||||
hide: parseArray(hide),
|
hide: parseArray(hide),
|
||||||
show_icons: parseBoolean(show_icons),
|
show_icons: parseBoolean(show_icons),
|
||||||
@ -65,4 +62,7 @@ module.exports = async (req, res) => {
|
|||||||
theme,
|
theme,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
} catch (err) {
|
||||||
|
return res.send(renderError(err.message, err.secondaryMessage));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@ -27,9 +27,6 @@ module.exports = async (req, res) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
repoData = await fetchRepo(username, repo);
|
repoData = await fetchRepo(username, repo);
|
||||||
} catch (err) {
|
|
||||||
return res.send(renderError(err.message, err.secondaryMessage));
|
|
||||||
}
|
|
||||||
|
|
||||||
let cacheSeconds = clampValue(
|
let cacheSeconds = clampValue(
|
||||||
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
|
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.setHeader("Cache-Control", `public, max-age=${cacheSeconds}`);
|
||||||
|
|
||||||
res.send(
|
return res.send(
|
||||||
renderRepoCard(repoData, {
|
renderRepoCard(repoData, {
|
||||||
title_color,
|
title_color,
|
||||||
icon_color,
|
icon_color,
|
||||||
@ -62,4 +59,7 @@ module.exports = async (req, res) => {
|
|||||||
show_owner: parseBoolean(show_owner),
|
show_owner: parseBoolean(show_owner),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
} catch (err) {
|
||||||
|
return res.send(renderError(err.message, err.secondaryMessage));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@ -29,9 +29,6 @@ module.exports = async (req, res) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
topLangs = await fetchTopLanguages(username);
|
topLangs = await fetchTopLanguages(username);
|
||||||
} catch (err) {
|
|
||||||
return res.send(renderError(err.message, err.secondaryMessage));
|
|
||||||
}
|
|
||||||
|
|
||||||
const cacheSeconds = clampValue(
|
const cacheSeconds = clampValue(
|
||||||
parseInt(cache_seconds || CONSTANTS.TWO_HOURS, 10),
|
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.setHeader("Cache-Control", `public, max-age=${cacheSeconds}`);
|
||||||
|
|
||||||
res.send(
|
return res.send(
|
||||||
renderTopLanguages(topLangs, {
|
renderTopLanguages(topLangs, {
|
||||||
hide_title: parseBoolean(hide_title),
|
hide_title: parseBoolean(hide_title),
|
||||||
hide_border: parseBoolean(hide_border),
|
hide_border: parseBoolean(hide_border),
|
||||||
@ -54,4 +51,7 @@ module.exports = async (req, res) => {
|
|||||||
layout,
|
layout,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
} catch (err) {
|
||||||
|
return res.send(renderError(err.message, err.secondaryMessage));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user