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

@@ -29,15 +29,6 @@ export async function markEpisodeAsWatched(
) {
const client = new GraphQLClient("https://graphql.anilist.co/");
console.log(aniListToken);
console.log(
typeof aniListToken,
titleId,
typeof titleId,
episodeNumber,
typeof episodeNumber,
markTitleAsComplete,
);
const mutation = markTitleAsComplete
? client.request(
MarkTitleAsWatchedMutation,

View File

@@ -94,9 +94,8 @@ app.openapi(route, async (c) => {
);
}
} catch (error) {
console.error(
new Error("Failed to mark episode as watched", { cause: error }),
);
console.error("Failed to mark episode as watched");
console.error(error);
return c.json(ErrorResponse, { status: 500 });
}