diff --git a/src/Authenticator/GpgAuthenticator.php b/src/Authenticator/GpgAuthenticator.php index 8acbde885f..064263bdd7 100644 --- a/src/Authenticator/GpgAuthenticator.php +++ b/src/Authenticator/GpgAuthenticator.php @@ -27,6 +27,7 @@ use Cake\Core\Configure; use Cake\Http\Exception\ForbiddenException; use Cake\Http\Exception\InternalErrorException; +use Cake\Log\Log; use Cake\Http\Response; use Cake\Http\ServerRequest; use Cake\ORM\TableRegistry; @@ -342,9 +343,12 @@ private function _initKeyring(): void $this->_gpg->importServerKeyInKeyring(); $this->_gpg->setDecryptKeyFromFingerprint($fingerprint, $passphrase); } catch (Exception $exception) { - $msg = __('The OpenPGP server key defined in the config cannot be used to decrypt.') . ' '; - $msg .= $exception->getMessage(); - throw new InternalErrorException($msg, 500, $exception); + Log::error('GpgAuthenticator: ' . $exception->getMessage()); + throw new InternalErrorException( + __('The OpenPGP server key defined in the config cannot be used to decrypt.'), + 500, + $exception + ); } } }