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:
Michael Zetterberg
2024-07-24 11:32:15 +02:00
parent 80c80fe1bd
commit 71dcf30719
18 changed files with 56 additions and 46 deletions

View File

@@ -47,7 +47,7 @@ export const baseQueryRouter = router({
)
if (!validatedContactConfigConfig.success) {
console.info(
console.error(
`Failed to validate Contact Config Data - (lang: ${ctx.lang})`
)
console.error(validatedContactConfigConfig.error)
@@ -85,7 +85,7 @@ export const baseQueryRouter = router({
)
if (!validatedHeaderConfig.success) {
console.info(`Failed to validate Header - (lang: ${input.lang})`)
console.error(`Failed to validate Header - (lang: ${input.lang})`)
console.error(validatedHeaderConfig.error)
return null
}
@@ -126,7 +126,7 @@ export const baseQueryRouter = router({
)
if (!validatedFooterConfig.success) {
console.info(`Failed to validate Footer - (lang: ${input.lang})`)
console.error(`Failed to validate Footer - (lang: ${input.lang})`)
console.error(validatedFooterConfig.error)
return null
}