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:
@@ -45,7 +45,7 @@ export const hotelQueryRouter = router({
|
||||
)
|
||||
|
||||
if (!validatedHotelData.success) {
|
||||
console.info(`Get Individual Hotel Data - Verified Data Error`)
|
||||
console.error(`Get Individual Hotel Data - Verified Data Error`)
|
||||
console.error(validatedHotelData.error)
|
||||
throw badRequestError()
|
||||
}
|
||||
@@ -56,7 +56,7 @@ export const hotelQueryRouter = router({
|
||||
.map((roomCategory) => {
|
||||
const validatedRoom = RoomSchema.safeParse(roomCategory)
|
||||
if (!validatedRoom.success) {
|
||||
console.info(`Get Room Category Data - Verified Data Error`)
|
||||
console.error(`Get Room Category Data - Verified Data Error`)
|
||||
console.error(validatedRoom.error)
|
||||
throw badRequestError()
|
||||
}
|
||||
@@ -83,7 +83,7 @@ export const hotelQueryRouter = router({
|
||||
const validatedHotelData = getRatesSchema.safeParse(tempRatesData)
|
||||
|
||||
if (!validatedHotelData.success) {
|
||||
console.info(`Get Individual Rates Data - Verified Data Error`)
|
||||
console.error(`Get Individual Rates Data - Verified Data Error`)
|
||||
console.error(validatedHotelData.error)
|
||||
throw badRequestError()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user