diff --git a/lib/SimpleSAML/Auth/Default.php b/lib/SimpleSAML/Auth/Default.php
index 5b60c90dc1597ad9bdc79741f6e28c15c48a1b31..a71358c96788388be0e05b2013f04747f71bd069 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);
 	}