egametang/ET · error · RpcException

service discovery proxy service call error request: {request

Error message

service discovery proxy service call error request: {requestName} sceneType: {sceneTypeName} error: {error} message: {message}

What it means

RpcException thrown at line 379 in CallBySceneTypeAsync on the throwResponseError=true path: the target service returned Error != ERR_Success, but unlike 337 the error is NOT retryable (or the caller explicitly opted into throwing all non-success responses). The response is disposed and the error code/message wrapped and thrown to the caller. This is the explicit 'surface the service's business error' failure.

Source

Thrown at Packages/cn.etetet.servicediscovery/Scripts/Hotfix/Server/ServiceDiscoveryProxySystem.cs:379

                        throw new Exception(
                            $"service discovery proxy service response type mismatch request: {requestName}, actual: {rawResponse?.GetType().Name}");
                    }

                    if (ShouldRetryServiceCallError(response.Error))
                    {
                        int error = response.Error;
                        string message = response.Message;
                        (response as MessageObject)?.Dispose();
                        throw new RpcException(error,
                            $"service discovery proxy retryable service call error request: {requestName} sceneType: {sceneTypeName} error: {error} message: {message}");
                    }

                    if (throwResponseError && response.Error != ErrorCode.ERR_Success)
                    {
                        int error = response.Error;
                        string message = response.Message;
                        (response as MessageObject)?.Dispose();
                        throw new RpcException(error,
                            $"service discovery proxy service call error request: {requestName} sceneType: {sceneTypeName} error: {error} message: {message}");
                    }

                    return response;
                }
                catch (RpcException rpcException)
                {
                    ++retryCount;
                    self = selfRef;
                    if (self == null)
                    {
                        throw new Exception("service discovery proxy disposed");
                    }

                    if (!ShouldRetryServiceCallError(rpcException.Error) || retryCount >= self.ServiceResolveRetryTimes)
                    {
                        throw;
                    }

View on GitHub (pinned to 5cab01f7a8)

Solutions

  1. Handle the RpcException at the call site per the target service's contract (it is an application error, not infrastructure).
  2. If the error is unexpected, inspect its code/message to map it to the target service's failure modes.
  3. Only set throwResponseError=true when the caller is prepared to catch and interpret business errors.

Example fix

// before
var resp = await proxy.CallBySceneTypeAsync<T>(sceneType, req, name, throwResponseError: true);

// after: handle the business error explicitly
catch (RpcException e)
{
    Log.Warning($"service {name} returned business error {e.Error}: {e.Message}");
    // map e.Error to a caller-facing result
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Only request thrown errors when you intend to handle business errors.
bool throwResponseError = callerCanHandleBusinessError;

Try / catch

catch (RpcException e)
{
    // business/application error from the target service (non-retryable)
    Log.Warning($"service {name} business error {e.Error}: {e.Message}");
    // map e.Error to a caller-facing result
}

Prevention

When it happens

Trigger: CallBySceneTypeAsync is called with throwResponseError=true and the resolved service returns a non-success, non-retryable error code (an application/business error). The proxy does not retry and propagates it immediately.

Common situations: The target service rejected the request for a business reason (not found, invalid state, permission); the caller chose throwResponseError=true to get exceptions instead of inspecting response.Error; a non-failover error code that the proxy will not retry.

Related errors


AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13). Data as JSON: /api/errors/f1c9e6a552d83ca2. Report an issue: GitHub.