errorTriggered callback returns undefined
Closed this issue ยท 2 comments
karltaylor commented
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?
laander commented
@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/)
laander commented
@karltaylor The fix has been released in v2.0.2
now ๐