summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Morken <olav.morken@uninett.no>2009-07-13 06:18:08 +0000
committerOlav Morken <olav.morken@uninett.no>2009-07-13 06:18:08 +0000
commitf09ee1fbe698cb0ec5adb8793ed6b754e8530a96 (patch)
treeb1263259fb4a32c06213a6aa828a541fb5e167b2
parent6798d5fd688af3ead93c3b591d738c9ce166a4b2 (diff)
downloadsimplesamlphp-f09ee1fbe698cb0ec5adb8793ed6b754e8530a96.zip
simplesamlphp-f09ee1fbe698cb0ec5adb8793ed6b754e8530a96.tar.gz
simplesamlphp-f09ee1fbe698cb0ec5adb8793ed6b754e8530a96.tar.bz2
Auth_Default: Handle exceptions thrown in the authenticate function.
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1573 44740490-163a-0410-bde0-09ae8108e29a
-rw-r--r--lib/SimpleSAML/Auth/Default.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/SimpleSAML/Auth/Default.php b/lib/SimpleSAML/Auth/Default.php
index 5b60c90..a71358c 100644
--- a/lib/SimpleSAML/Auth/Default.php
+++ b/lib/SimpleSAML/Auth/Default.php
@@ -62,7 +62,14 @@ class SimpleSAML_Auth_Default {
throw new Exception('Invalid authentication source: ' . $authId);
}
- $as->authenticate($state);
+ try {
+ $as->authenticate($state);
+ } catch (SimpleSAML_Error_Exception $e) {
+ SimpleSAML_Auth_State::throwException($state, $e);
+ } catch (Exception $e) {
+ $e = new SimpleSAML_Error_UnserializableException($e);
+ SimpleSAML_Auth_State::throwException($state, $e);
+ }
self::loginCompleted($state);
}