private static JsonRpcError getError(final TransactionProcessingResult result) {
    if (result.getRevertReason().isPresent()) {
      return new JsonRpcError(
          RpcErrorType.REVERT_ERROR, result.getRevertReason().get().toHexString());
    } else if (result.getExceptionalHaltReason().isPresent()) {
      return new JsonRpcError(
          -32015, result.getExceptionalHaltReason().get().getDescription(), null);
    }
    return null;
  }
Determines the appropriate {@link JsonRpcError} based on the transaction processing result.

<p>This method checks for revert reasons and exceptional halt reasons to construct an
appropriate error message.

@param result the result of processing a transaction
@return a {@link JsonRpcError} representing the error encountered during transaction
    processing, or {@code null} if no error occurred
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockStateCallResult.java