diff --git a/module/VuFind/src/VuFind/ILS/Driver/PAIA.php b/module/VuFind/src/VuFind/ILS/Driver/PAIA.php
index 1e22f414021544cb18352ed5111cc72a6f4f9afb..b05f9997c97ef3d341b171b07aab457f7778a788 100644
--- a/module/VuFind/src/VuFind/ILS/Driver/PAIA.php
+++ b/module/VuFind/src/VuFind/ILS/Driver/PAIA.php
@@ -954,7 +954,7 @@ class PAIA extends DAIA
             case 'access_denied':
                 throw new AuthException(
                     $array['error_description'] ?? $array['error'],
-                    $array['code'] ?? ''
+                    (int)($array['code'] ?? 0)
                 );
 
                 // invalid_grant     401     The access token was missing, invalid
@@ -966,7 +966,7 @@ class PAIA extends DAIA
             case 'insufficient_scope':
                 throw new ForbiddenException(
                     $array['error_description'] ?? $array['error'],
-                    $array['code'] ?? ''
+                    (int)($array['code'] ?? 0)
                 );
 
                 // not_found     404     Unknown request URL or unknown patron.
@@ -1013,7 +1013,7 @@ class PAIA extends DAIA
             default:
                 throw new ILSException(
                     $array['error_description'] ?? $array['error'],
-                    $array['code'] ?? ''
+                    (int)($array['code'] ?? 0)
                 );
             }
         }