Skip to content

Commit

Permalink
Add onError action callback (#427)
Browse files Browse the repository at this point in the history
This allows users of the component to handle errors that happen while async loading the `intl-tel-input` library.
  • Loading branch information
Turbo87 authored Mar 23, 2022
1 parent 7e27503 commit 13e2c5d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions addon/components/phone-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ export default Component.extend({
'countrychange',
this._onCountryChange.bind(this)
);
} catch (error) {
if (this.onError) {
this.onError(error);
}
} finally {
if (!this.isDestroying && !this.isDestroyed) {
this.set('isLoadingIti', false);
Expand Down

0 comments on commit 13e2c5d

Please sign in to comment.