improve logging?

This commit is contained in:
Thomas Ruoff
2022-06-23 21:36:43 +02:00
committed by Thomas Ruoff
parent 942066bc7a
commit 00002a62d2
15 changed files with 91 additions and 50 deletions

View File

@@ -1,6 +1,7 @@
import React, { useEffect, useReducer } from 'react'
import { useRouter } from 'next/router'
import { clearBookingData, loadBookingData } from '../helpers/storage'
import { log } from '../helpers/log'
import { createBooking } from '../helpers/booking'
import { Booking } from '../db/booking'
@@ -156,7 +157,7 @@ export default function BookProvider({ children }) {
const booking = await createBooking(state.formData)
router.push(`/bookings/${booking.uuid}/stored`)
} catch (error) {
console.error(error)
log.error('Failed to store booking', error)
dispatch({ type: ACTIONS.POST_DATA_ERROR, payload: error.message })
}
}