fix: make sure all logged errors are preceeded with a message
Just logging an error makes it difficult to relate the error log to code in the codebase. Error logging a message right before the error itself makes it easier to search the codebase for that error log.
This commit is contained in:
@@ -88,7 +88,7 @@ export const loyaltyPageQueryRouter = router({
|
||||
const validatedLoyaltyPageRefs =
|
||||
validateLoyaltyPageRefsSchema.safeParse(cleanedData)
|
||||
if (!validatedLoyaltyPageRefs.success) {
|
||||
console.info(
|
||||
console.error(
|
||||
`Failed to validate Loyaltypage Refs - (lang: ${lang}, uid: ${uid})`
|
||||
)
|
||||
console.error(validatedLoyaltyPageRefs.error)
|
||||
@@ -219,7 +219,7 @@ export const loyaltyPageQueryRouter = router({
|
||||
validateLoyaltyPageSchema.safeParse(loyaltyPage)
|
||||
|
||||
if (!validatedLoyaltyPage.success) {
|
||||
console.info(
|
||||
console.error(
|
||||
`Failed to validate Loyaltypage Data - (lang: ${lang}, uid: ${uid})`
|
||||
)
|
||||
console.error(validatedLoyaltyPage.error)
|
||||
|
||||
Reference in New Issue
Block a user