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:
@@ -40,7 +40,7 @@ async function getLoyaltyPageBreadcrumbs(variables: Variables) {
|
||||
)
|
||||
|
||||
if (!validatedRefsData.success) {
|
||||
console.info(
|
||||
console.error(
|
||||
`Failed to validate Loyaltypage Breadcrumbs Refs - (url: ${variables.url})`
|
||||
)
|
||||
console.error(validatedRefsData.error)
|
||||
@@ -63,7 +63,7 @@ async function getLoyaltyPageBreadcrumbs(variables: Variables) {
|
||||
validateLoyaltyPageBreadcrumbsContentstackSchema.safeParse(response.data)
|
||||
|
||||
if (!validatedBreadcrumbsData.success) {
|
||||
console.info(
|
||||
console.error(
|
||||
`Failed to validate Loyaltypage Breadcrumbs Data - (url: ${variables.url})`
|
||||
)
|
||||
console.error(validatedBreadcrumbsData.error)
|
||||
@@ -87,7 +87,7 @@ async function getMyPagesBreadcrumbs(variables: Variables) {
|
||||
refsResponse.data
|
||||
)
|
||||
if (!validatedRefsData.success) {
|
||||
console.info(
|
||||
console.error(
|
||||
`Failed to validate My Page Breadcrumbs Refs - (url: ${variables.url})`
|
||||
)
|
||||
console.error(validatedRefsData.error)
|
||||
@@ -110,7 +110,7 @@ async function getMyPagesBreadcrumbs(variables: Variables) {
|
||||
validateMyPagesBreadcrumbsContentstackSchema.safeParse(response.data)
|
||||
|
||||
if (!validatedBreadcrumbsData.success) {
|
||||
console.info(
|
||||
console.error(
|
||||
`Failed to validate My Page Breadcrumbs Data - (url: ${variables.url})`
|
||||
)
|
||||
console.error(validatedBreadcrumbsData.error)
|
||||
|
||||
Reference in New Issue
Block a user