mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-09-03 14:18:20 +00:00
Gist card: handle not found error (#3100)
This commit is contained in:
@@ -60,6 +60,7 @@ const fetchGist = async (id) => {
|
||||
if (!id) throw new MissingParamError(["id"], "/api/gist?id=GIST_ID");
|
||||
const res = await retryer(fetcher, { gistName: id });
|
||||
if (res.data.errors) throw new Error(res.data.errors[0].message);
|
||||
if (!res.data.data.viewer.gist) throw new Error("Gist not found");
|
||||
const data = res.data.data.viewer.gist;
|
||||
return {
|
||||
name: data.files[Object.keys(data.files)[0]].name,
|
||||
|
||||
Reference in New Issue
Block a user