feat: add more error handling
This commit is contained in:
@@ -28,5 +28,12 @@ export async function fetchTitleFromAnilist(
|
||||
|
||||
return client
|
||||
.request(GetTitleQuery, { id }, headers)
|
||||
.then((data) => data?.Media ?? undefined);
|
||||
.then((data) => data?.Media ?? undefined)
|
||||
.catch((error) => {
|
||||
if (error.message.includes("Not Found")) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user