Wrap model phonenumber validation in try/catch

This commit is contained in:
lilia 2015-02-07 16:19:04 -10:00
parent eae072e72d
commit c84ccfc735

View file

@ -47,6 +47,7 @@
// hack
if (this.get('type') === 'private') {
try {
this.id = libphonenumber.util.verifyNumber(this.id);
var number = libphonenumber.util.splitCountryCode(this.id);
@ -55,7 +56,9 @@
national_number: '' + number.national_number,
international_number: '' + number.country_code + number.national_number
});
} catch(ex) {
return ex;
}
}
},