Exceptions

This section explains the different exceptions used in the project.

NegativeResponseException

class udsoncan.exceptions.NegativeResponseException(response, *args, **kwargs)[source]

Raised when the server returns a negative response (response code starting by 0x7F). The response that triggered the exception is available in e.response

Parameters:

response (Response) – The response that triggered the exception

InvalidResponseException

class udsoncan.exceptions.InvalidResponseException(response, *args, **kwargs)[source]

Raised when a service fails to decode a server response data. A bad message length or a value that is out of range may both be valid causes. The response that triggered the exception is available in e.response

Parameters:

response (Response) – The response that triggered the exception

UnexpectedResponseException

class udsoncan.exceptions.UnexpectedResponseException(response, details='<No details given>', *args, **kwargs)[source]

Raised when the client receives a valid response but considers the one received to not be the expected response. The response that triggered the exception is available in e.response

Parameters:
  • response (Response) – The response that triggered the exception

  • details (string) – Additional details about the error

TimeoutException

class udsoncan.exceptions.TimeoutException(*args, **kwargs)[source]

Simple extension of Exception with no additional property. Raised when a timeout in the communication happens.

ConfigError

class udsoncan.exceptions.ConfigError(key, msg='<No details given>', *args, **kwargs)[source]

Raised when a bad configuration element is encountered.

Parameters:

key (object) – The configuration key that failed to resolve properly