kbjr / ExtID

OpenID and OAuth together in one easy-to-use external ID library
Other
6 stars 0 forks source link

Exception handler for wrong openid url #4

Closed kirs closed 13 years ago

kirs commented 13 years ago

If incorrect openid url entered, library returns exception:

Fatal error: Uncaught exception 'ExtID_Exception' with message 'OpenID provider URL provided was invalid' in /Users/kir/Sites/123/system/application/libraries/ExtID.php:262 Stack trace: #0 /Users/kir/Sites/123/system/application/libraries/ExtID.php(547): ExtID->raise('OpenID provider...') #1 /Users/kir/Sites/123/system/application/controllers/auth.php(21): ExtID->authenticate() #2 [internal function]: Auth->login('default', 'openid') #3 /Users/kir/Sites/123/system/codeigniter/CodeIgniter.php(236): call_user_func_array(Array, Array) #4 /Users/kir/Sites/123/index.php(115): require_once('/Users/kir/Site...') #5 {main} thrown in /Users/kir/Sites/123/system/application/libraries/ExtID.php on line 262

kirs commented 13 years ago

We need to add handler for this exception.

kbjr commented 13 years ago

i didn't want to impose a specific way of handling errors on the developer, i decided to just let the library throw and error and the developers can decide themselves how to handle them. if you can think of a non-intrusive, intuitive way of handling errors, then i'll look at it. but otherwise, i'm inclined to leave it how it is.

kirs commented 13 years ago

Okay, but could you add an example of wrong openid handling in controller?

kbjr commented 13 years ago

alright, error handling has been added to the examples.

kirs commented 13 years ago

Thanks!