Handle InvalidArgumentException in RPC processing and update error messages

This commit is contained in:
netkas 2025-03-03 04:25:40 -05:00
parent bb94ae8d78
commit f1dbf5a4d0

View file

@ -625,6 +625,11 @@
Logger::getLogger()->error('An error occurred while processing the RPC request', $e); Logger::getLogger()->error('An error occurred while processing the RPC request', $e);
$results[] = $e->produceError($rpcRequest); $results[] = $e->produceError($rpcRequest);
} }
catch(InvalidArgumentException $e)
{
Logger::getLogger()->error('Caught invalid argument exception', $e);
$results[] = $rpcRequest->produceError(StandardError::RPC_INVALID_ARGUMENTS, $e->getMessage());
}
catch(Exception $e) catch(Exception $e)
{ {
Logger::getLogger()->error('An internal error occurred while processing the RPC request', $e); Logger::getLogger()->error('An internal error occurred while processing the RPC request', $e);
@ -634,7 +639,7 @@
} }
else else
{ {
$results[] = $rpcRequest->produceError(StandardError::INTERNAL_SERVER_ERROR); $results[] = $rpcRequest->produceError(StandardError::INTERNAL_SERVER_ERROR, 'Uncaught Exception');
} }
} }
} }
@ -931,7 +936,7 @@
try try
{ {
return $client->resolvePeerSignature($peerAddress, $signatureUuid); return $client->resolveSignature($peerAddress, $signatureUuid);
} }
catch(RpcException $e) catch(RpcException $e)
{ {