lekoala / bootstrap5-autocomplete

Autocomplete for Bootstrap 5 (and 4!)
MIT License
87 stars 16 forks source link

Add support for custom server error response handlers #45

Closed dabico closed 7 months ago

dabico commented 7 months ago

I started integrating this library into my projects (phenomenal work by the way), but I noticed that there is no way of specifying custom error handlers when fetch fails:

https://github.com/lekoala/bootstrap5-autocomplete/blob/a1feee07c7d4241234802aa357b06f43936bf703/autocomplete.js#L1236-L1242

It would be nice if we had an error-handling equivalent to onServerResponse (i.e. onServerUnreachable or onFailedFetch), as onAfterFetch does not provide access to the returned Promise.

lekoala commented 7 months ago

hi @dabico thanks for the kind words it's really easy to add, it's on master now https://github.com/lekoala/bootstrap5-autocomplete/commit/4055369a6adb50e62637a1a10da3415c9ebc25e7 it's cleaner to have it configurable anyway :)

dabico commented 7 months ago

Wonderful! Patiently waiting for the next release 😄

lekoala commented 7 months ago

done :)