mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-13 11:03:49 +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 });
|
||||
} 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 });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user