Comments (2)
Using SPL Exceptions is fine but I would agree that some exceptions your are throwing are strange. For Instance DataProvider::getAlpha2
only accept strings. So if I gave it an array I would expect an InvalidArgumentException
to be thrown not a DomainException
.
So re-arranging the exceptions thrown should be a good Idea 👍 .
Adding more exception classes while the SPL Exception seem to cover all the library exceptions (AFAIK) seems strange to me.
from iso3166.
That is true to a certain extend. However, ambiguity arises if you let exceptions bubble up in your application. You cannot reliably assume that any DomainException
or InvalidArgumentException
was specifically thrown by this library or a specific method in this library. Whereas if the type of exception was more explicit and it was namespaced, you could.
from iso3166.
Related Issues (20)
- Use of the definite article (the) in country names HOT 5
- XK is missing HOT 1
- Empty string search returns Afghanistan because it is a very first value in country list HOT 5
- I suggest changing the source also to my repo where I keep the updated list from iso.org HOT 1
- Adding flags for EEC country members HOT 1
- Aliases HOT 5
- Project Name? HOT 1
- shouldn't the main API be static? HOT 1
- "Czech Republic" or "Czechia" (Alias -feature request) HOT 4
- PHP 8.1 Deprecation message HOT 2
- Missed Netherlands Antilles (feature request) HOT 2
- Language to be used for default locales
- New release to prevent deprecations triggered on PHP 8.1 HOT 4
- Freezes downloading on Composer install HOT 1
- Missing entry for Canary Islands HOT 2
- Canary Islands is not present in the library HOT 1
- It will be nice if structure can return Nationality also
- Croatia currency updated in 2023 HOT 1
- Make ISO3166 more "extendable" HOT 1
- Multibyte string extension does not described in composer.json schema. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iso3166.