egametang/ET · error · Exception
default conn throw Exception!
Error message
default conn throw Exception! {channelId} What it means
AService.GetChannelConn is a virtual method whose base implementation throws, signalling that the default service does not track per-channel connection ids. Only KCP-style services override it to return (LocalConn, RemoteConn); calling it on a base or non-KCP service is a contract violation.
Solutions
- Call GetChannelConn only on services known to override it (KService).
- If you author an AService subclass that needs conn ids, override GetChannelConn.
- Check the concrete service type before invoking.
Example fix
// before
(uint l, uint r) = anyService.GetChannelConn(channelId);
// after
if (service is KService kService)
(uint l, uint r) = kService.GetChannelConn(channelId); Defensive patterns
Strategy: type-guard
Validate before calling
null
Type guard
public static bool SupportsGetChannelConn(AService s) => s is KService;
Try / catch
null
Prevention
- Program against the concrete service type when you need conn ids.
- Document which AService subclasses override GetChannelConn.
- Add a virtual default that returns a sentinel instead of throwing if a softer contract is acceptable.
When it happens
Trigger: Holding an AService reference (not the concrete KService) and calling GetChannelConn on a TCP/websocket service that never overrode it, or on a custom AService subclass that forgot the override.
Common situations: New AService implementation not yet implementing conn tracking, or generic code that assumes all services support GetChannelConn.
Related errors
- bind error
- bind error
- bufferList length < count
- bufferList length < coutn, buffer length
- {e.LastOperation}
AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13).
Data as JSON: /api/errors/5a2171af027fc6d8.
Report an issue: GitHub.
Appendix: source
Thrown at Packages/cn.etetet.core/Scripts/Core/Share/Network/AService.cs:83
this.Id = 0;
}
public abstract void Update();
public abstract void Remove(long id, int error = 0);
public bool IsDisposed()
{
return this.Id == 0;
}
public abstract void Create(long id, IPEndPoint ipEndPoint);
public abstract void Send(long channelId, MemoryBuffer memoryBuffer);
public virtual (uint, uint) GetChannelConn(long channelId)
{
throw new Exception($"default conn throw Exception! {channelId}");
}
public virtual void ChangeAddress(long channelId, IPEndPoint ipEndPoint)
{
}
}
}View on GitHub (pinned to 5cab01f7a8)