Improved exception handling

This commit is contained in:
netkas 2025-02-11 13:16:23 -05:00
parent ee48456f2f
commit a456dda62d

View file

@ -27,10 +27,9 @@
throw new MissingRpcArgumentException('answer'); throw new MissingRpcArgumentException('answer');
} }
$session = $request->getSession();
try try
{ {
$session = $request->getSession();
if(CaptchaManager::getCaptcha($session->getPeerUuid())?->isExpired()) if(CaptchaManager::getCaptcha($session->getPeerUuid())?->isExpired())
{ {
return $rpcRequest->produceError(StandardError::EXPIRED, 'The captcha has expired'); return $rpcRequest->produceError(StandardError::EXPIRED, 'The captcha has expired');