fix: improve error logging

Cloudflare doesn't log causes, only the messages so splitting the logs in to 2
This commit is contained in:
2024-10-27 08:48:55 -04:00
parent 34958cfa69
commit 2dcf8630ab
9 changed files with 16 additions and 32 deletions

View File

@@ -46,11 +46,9 @@ export async function getEpisodesFromAnify(
abortController.abort("Loading episodes from Anify timed out");
}
console.error(
new Error(
`Error trying to load episodes from anify; aniListId: ${aniListId}`,
{ cause: e },
),
`Error trying to load episodes from anify; aniListId: ${aniListId}`,
);
console.error(e);
}
if (!response || response.length === 0) {

View File

@@ -68,11 +68,9 @@ export async function getEpisodesFromAniwatch(
}
console.error(
new Error(
`Error trying to load episodes from aniwatch; aniListId: ${aniListId}`,
{ cause: error },
),
`Error trying to load episodes from aniwatch; aniListId: ${aniListId}`,
);
console.error(error);
}
return null;

View File

@@ -29,11 +29,9 @@ export async function getEpisodesFromConsumet(
} catch (error: any) {
if (!error.message.includes("failed with status code")) {
console.error(
new Error(
`Error trying to load episodes from consumet; aniListId: ${aniListId}`,
{ cause: error },
),
`Error trying to load episodes from consumet; aniListId: ${aniListId}`,
);
console.error(error);
}
}