Skip to content
Snippets Groups Projects
Commit 908367e2 authored by Demian Katz's avatar Demian Katz
Browse files

Merge pull request #551 from EreMaijala/auth-exception

Pass Auth exceptions through on login so that custom error messages c…
parents 9712987f 0de0436e
No related merge requests found
...@@ -113,6 +113,9 @@ class ILS extends AbstractBase ...@@ -113,6 +113,9 @@ class ILS extends AbstractBase
// Connect to catalog: // Connect to catalog:
try { try {
$patron = $this->getCatalog()->patronLogin($username, $password); $patron = $this->getCatalog()->patronLogin($username, $password);
} catch (AuthException $e) {
// Pass Auth exceptions through
throw $e;
} catch (\Exception $e) { } catch (\Exception $e) {
throw new AuthException('authentication_error_technical'); throw new AuthException('authentication_error_technical');
} }
......
...@@ -71,6 +71,9 @@ class MultiILS extends ILS ...@@ -71,6 +71,9 @@ class MultiILS extends ILS
// Connect to catalog: // Connect to catalog:
try { try {
$patron = $this->getCatalog()->patronLogin($username, $password); $patron = $this->getCatalog()->patronLogin($username, $password);
} catch (AuthException $e) {
// Pass Auth exceptions through
throw $e;
} catch (\Exception $e) { } catch (\Exception $e) {
throw new AuthException('authentication_error_technical'); throw new AuthException('authentication_error_technical');
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment