Adding additional logging to the $id endpoint
This commit is contained in:
@@ -48,6 +48,10 @@ export const loader: LoaderFunction = async ({ params, request }) => {
|
||||
const jsonResponse = await safeFetch(doc.url);
|
||||
|
||||
if (!jsonResponse.ok) {
|
||||
console.log(
|
||||
`Failed to fetch ${doc.url}: ${jsonResponse.status} (${jsonResponse.statusText})`
|
||||
);
|
||||
|
||||
throw new Response(jsonResponse.statusText, {
|
||||
status: jsonResponse.status,
|
||||
});
|
||||
@@ -55,6 +59,8 @@ export const loader: LoaderFunction = async ({ params, request }) => {
|
||||
|
||||
const json = await jsonResponse.json();
|
||||
|
||||
console.log(`Fetched ${doc.url} with json, returning...`);
|
||||
|
||||
return {
|
||||
doc,
|
||||
json,
|
||||
|
||||
Reference in New Issue
Block a user