Class SyncException
- Namespace
- SteamNetworkLib.Exceptions
- Assembly
- SteamNetworkLib.dll
Exception thrown when a SyncVar or Steam data synchronization operation fails.
public class SyncException : SteamNetworkException, ISerializable
- Inheritance
-
SyncException
- Implements
- Derived
- Inherited Members
Remarks
This exception is part of the SteamNetworkLib exception family, so callers can catch SteamNetworkException for all library-level failures or catch SyncException when they need synchronization-specific details.
The SyncKey property is populated when the failed operation is tied to a specific lobby, member, host, or client sync key.
Constructors
SyncException(string)
Initializes a new instance of the SyncException class.
public SyncException(string message)
Parameters
messagestringThe message that describes the error.
SyncException(string, Exception)
Initializes a new instance of the SyncException class.
public SyncException(string message, Exception innerException)
Parameters
messagestringThe message that describes the error.
innerExceptionExceptionThe exception that caused the current exception.
SyncException(string, string)
Initializes a new instance of the SyncException class with key information.
public SyncException(string message, string syncKey)
Parameters
messagestringThe message that describes the error.
syncKeystringThe sync key associated with the operation.
SyncException(string, string?, SteamNetworkErrorKind, string?, bool)
Initializes a new instance of the SyncException class with structured diagnostic details.
public SyncException(string message, string? syncKey, SteamNetworkErrorKind errorKind, string? operation = null, bool isRetryable = false)
Parameters
messagestringThe message that describes the error.
syncKeystringThe sync key associated with the operation.
errorKindSteamNetworkErrorKindThe broad reason the operation failed.
operationstringThe API operation or lifecycle step that failed.
isRetryableboolTrue when retrying later may succeed; otherwise, false.
SyncException(string, string, Exception)
Initializes a new instance of the SyncException class with full details.
public SyncException(string message, string syncKey, Exception innerException)
Parameters
messagestringThe message that describes the error.
syncKeystringThe sync key associated with the operation.
innerExceptionExceptionThe exception that caused the current exception.
SyncException(string, string?, Exception, SteamNetworkErrorKind, string?, bool)
Initializes a new instance of the SyncException class with structured diagnostic details and an inner exception.
public SyncException(string message, string? syncKey, Exception innerException, SteamNetworkErrorKind errorKind, string? operation = null, bool isRetryable = false)
Parameters
messagestringThe message that describes the error.
syncKeystringThe sync key associated with the operation.
innerExceptionExceptionThe exception that caused the current exception.
errorKindSteamNetworkErrorKindThe broad reason the operation failed.
operationstringThe API operation or lifecycle step that failed.
isRetryableboolTrue when retrying later may succeed; otherwise, false.
Properties
SyncKey
Gets the key associated with the sync operation, if available.
public string? SyncKey { get; }