timekit-io/booking-js

errorTriggered callback returns undefined

Closed this issue ยท 2 comments

Hey Timekit ๐Ÿ‘‹

I've added a errorTriggered callback but it returns undefined in the param as shown in your docs.

errorTriggered: function(message) {
  console.log(message) // undefined
}

I ended up using fetchAvailabilityFailed callback. But thought I'd flag anyway to see what errorTriggered is used for?

@karltaylor Thanks for reporting - you're right, the error message wasn't passed to the callback. I've fixed it now in #180 which I'll release later today.

The callback is only triggered when an exception is thrown in the library (in addition to failed API requests). This can useful if you're configuring booking.js using dynamic config values and want to catch issues as they occur (and e.g. report them using http://sentry.io/)

@karltaylor The fix has been released in v2.0.2 now ๐Ÿ‘