pH-7 / eu-vat-validator

:moneybag: A simple and clean PHP library that validates EU VAT registration numbers against the central ec.europa.eu database (using the official europa API) :eu:
https://github.com/pH-7/eu-vat-validator
GNU General Public License v3.0
93 stars 17 forks source link

The Constructor should throw the exception #3

Closed hkwak closed 6 years ago

hkwak commented 6 years ago

https://github.com/pH-7/eu-vat-validator/blob/7f7b5517e95c83be532b0c27fef13836a090b5ef/src/Vat/Provider/Europa.php#L29

The Constructor should throw the exception (kind of ConnectionNotEstablishedException or ProviderNotAvailableException) not just exit, to allow the outer code to deal with the problem (eg display the error message, retry after some delay, etc)

pH-7 commented 6 years ago

Fixed in https://github.com/pH-7/eu-vat-validator/pull/7