Skip to content

UdsException Class

Base type for every error surfaced by IUdsClient. Subclasses distinguish the three families the MVP cares about: a well-formed negative response from the ECU (UdsNegativeResponseException), an ECU that failed to respond within its P2/P2* budget (UdsTimeoutException), and a malformed response (UdsProtocolException). Transport-layer failures are re-thrown as-is: the protocol errors are typed as IsoTpException subclasses, but the channel also throws ObjectDisposedException (disposed during a send, or its bus service lost), InvalidOperationException (disposed during a receive) and the bus layer's own exception from a failed driver call, and those pass through untyped. Derives from CanKitException so L2/L3/L4 failures can be caught uniformly across the library (NFR-006 error architecture, arc42 ADR-12).

public class UdsException : CanKit.Core.Exceptions.CanKitException

Inheritance Object → Exception → CanKitException → UdsException

Derived
↳ UdsNegativeResponseException
↳ UdsProtocolException
↳ UdsTimeoutException

Constructors

UdsException(CanKitErrorCode, string) Constructor

Creates a new UDS error with a specific library error code.

protected UdsException(CanKit.Core.Exceptions.CanKitErrorCode errorCode, string message);

Parameters

errorCode CanKitErrorCode

message String

UdsException(string) Constructor

Creates a new UDS error with the given message.

public UdsException(string message);

Parameters

message String

UdsException(string, Exception) Constructor

Creates a new UDS error wrapping an inner cause.

public UdsException(string message, System.Exception innerException);

Parameters

message String

innerException Exception