From 86598c7c75795856fe7dcea40562e9bf9b3284d8 Mon Sep 17 00:00:00 2001
From: Dorian Merz <merz@ub.uni-leipzig.de>
Date: Wed, 18 Apr 2018 14:54:49 +0200
Subject: [PATCH] refs #12986-master * enhances paiaLogin error handling *
 surpasses VF4-policy of patronLogin returning null on login fail * mixed
 commit, TODO: sort out instance and finc-master parts

---
 module/finc/src/finc/ILS/Driver/PAIA.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/module/finc/src/finc/ILS/Driver/PAIA.php b/module/finc/src/finc/ILS/Driver/PAIA.php
index 8805bbf4ba3..3fb3aa87569 100644
--- a/module/finc/src/finc/ILS/Driver/PAIA.php
+++ b/module/finc/src/finc/ILS/Driver/PAIA.php
@@ -65,6 +65,8 @@ class PAIA extends \VuFind\ILS\Driver\PAIA
     const SCOPE_WRITE_ITEMS = 'write_items';
     const SCOPE_CHANGE_PASSWORD = 'change_password';
 
+    protected $last_error = null;
+
     /**
      * Constructor
      *
@@ -401,6 +403,7 @@ class PAIA extends \VuFind\ILS\Driver\PAIA
         //       error code 403 two differing errors are possible
         //       (cf.  http://gbv.github.io/paia/paia.html#request-errors)
         if (isset($array['error'])) {
+            $this->last_error = $array;
             switch ($array['error']) {
                 // cf. http://gbv.github.io/paia/paia.html#request-errors
                 // error        code    error_description
@@ -1258,4 +1261,8 @@ class PAIA extends \VuFind\ILS\Driver\PAIA
         }
         return false;
     }
+
+    public function getLastError() {
+        return $this->last_error;
+    }
 }
-- 
GitLab