Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/Authenticator/GpgAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
);
}
}
}
Expand Down