refactor(stats card fetcher): improve could not fetch total commits error message (#3255)

This commit is contained in:
Alexandr Garbuzov
2023-09-21 20:30:24 +02:00
committed by GitHub
parent 12f84f89c8
commit 65c3300189
2 changed files with 22 additions and 1 deletions
+4 -1
View File
@@ -180,7 +180,10 @@ const totalCommitsFetcher = async (username) => {
const totalCount = res.data.total_count;
if (!totalCount || isNaN(totalCount)) {
throw new Error("Could not fetch total commits.");
throw new CustomError(
"Could not fetch total commits.",
CustomError.GRAPHQL_ERROR,
);
}
return totalCount;
};