-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Add different Exception Types for different errors #250
Comments
I could suggest to consider "provider exceptions", "validation exceptions", "server exceptions", "network exception" and left "generics exceptions" as
Maybe a static method: private static function throws(Throwable $exception) {
throw new OpenIDConnectClientException('Errror', 0, $exception);
}
private function foo() {
self::throw(new OpenIDConnectProviderException('Unable to determine state');
} |
I want to add that meaninigful error codes should be provided as well. |
I'm coming from Code Triage and I'm not the repo owner, but I can creates a new PR and ask to owner if he is agree with change. cc: @jumbojett |
This PR is just to suggest an error factory suggested in feature request jumbojett#250 It doesn't covers all exceptions because I want to know if this can help or not. It creates an exception factory in order to throw specific exceptions and user can handle exceptions without to compare messages
Currently it's really difficult to handle different OpenID errors because the library uses only one exception class. Additionally it does not use exception codes thus requireing the developer to do string matching to actually figure out which error caused the exception.
Please introduce exception codes or different exception classes for different exceptions.
The text was updated successfully, but these errors were encountered: