mirror of
https://github.com/Aviortheking/codestats-readme.git
synced 2025-07-29 07:19:51 +00:00
feat: adde CustomError class for better secondary errors (#355)
This commit is contained in:
@ -38,12 +38,7 @@ module.exports = async (req, res) => {
|
||||
parseBoolean(include_all_commits)
|
||||
);
|
||||
} catch (err) {
|
||||
return res.send(
|
||||
renderError(
|
||||
err.message,
|
||||
"Make sure the provided username is not an organization"
|
||||
)
|
||||
);
|
||||
return res.send(renderError(err.message, err.secondaryMessage));
|
||||
}
|
||||
|
||||
const cacheSeconds = clampValue(
|
||||
|
@ -4,7 +4,6 @@ const {
|
||||
parseBoolean,
|
||||
clampValue,
|
||||
CONSTANTS,
|
||||
logger,
|
||||
} = require("../src/common/utils");
|
||||
const fetchRepo = require("../src/fetchers/repo-fetcher");
|
||||
const renderRepoCard = require("../src/cards/repo-card");
|
||||
@ -29,8 +28,7 @@ module.exports = async (req, res) => {
|
||||
try {
|
||||
repoData = await fetchRepo(username, repo);
|
||||
} catch (err) {
|
||||
logger.error(err);
|
||||
return res.send(renderError(err.message));
|
||||
return res.send(renderError(err.message, err.secondaryMessage));
|
||||
}
|
||||
|
||||
let cacheSeconds = clampValue(
|
||||
|
@ -30,7 +30,7 @@ module.exports = async (req, res) => {
|
||||
try {
|
||||
topLangs = await fetchTopLanguages(username);
|
||||
} catch (err) {
|
||||
return res.send(renderError(err.message));
|
||||
return res.send(renderError(err.message, err.secondaryMessage));
|
||||
}
|
||||
|
||||
const cacheSeconds = clampValue(
|
||||
|
Reference in New Issue
Block a user