mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-12 18:43:50 +00:00
refactor(#65): Enhance error logging with request context
This commit is contained in:
@@ -14,7 +14,14 @@ export const GET = async ({ url }) => {
|
|||||||
|
|
||||||
return json({ products, count });
|
return json({ products, count });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(error);
|
logger.error('Failed to fetch products', {
|
||||||
|
error: error.message,
|
||||||
|
stack: error.stack,
|
||||||
|
params: {
|
||||||
|
limit: limitParam,
|
||||||
|
offset: offsetParam
|
||||||
|
}
|
||||||
|
});
|
||||||
return json({ error: error.message }, { status: 500 });
|
return json({ error: error.message }, { status: 500 });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user