trex_exceptions Exceptions module

class trex_exceptions.CExceptionHandler(exceptions)[source]

CExceptionHandler is responsible for generating TRex API related exceptions in client side.

Instatiate a CExceptionHandler object

Parameters:
exceptions : list

a list of all TRex acceptable exception objects.

default list:
gen_exception(err)[source]

Generates an exception based on a general ProtocolError exception object err.

When TRex is reserved, no other user can start new TRex runs.

Parameters:
err : exception

a ProtocolError exception raised by trex_client.CTRexClient class

Returns:

A TRex exception from the exception list defined in class creation.

If such exception wasn’t found, returns a TRexException exception

exception trex_exceptions.RPCError(code, message, remote_data=None)[source]

This is the general RPC error exception class from which trex_exceptions.TRexException inherits.

Every exception in this class has as error format according to JSON-RPC convention convention: code, message and data.

exception trex_exceptions.TRexError(code, message, remote_data=None)[source]

This is the most general TRex exception.

This exception isn’t used by default and will only when an unrelated to ProtocolError will occur, and it can’t be resolved to any of the deriviate exceptions.

exception trex_exceptions.TRexException(code, message, remote_data=None)[source]

This is the most general TRex exception.

All exceptions inherits from this class has an error code and a default message which describes the most common use case of the error.

This exception isn’t used by default and will only when an unrelated to ProtocolError will occur, and it can’t be resolved to any of the deriviate exceptions.

exception trex_exceptions.TRexInUseError(code, message, remote_data=None)[source]

Indicates that TRex is currently in use

exception trex_exceptions.TRexIncompleteRunError(code, message, remote_data=None)[source]

Indicates that TRex has failed due to some reason. This Exception is used when TRex process itself terminated with error fault or it has been terminated by an external intervention in the OS.

exception trex_exceptions.TRexRequestDenied(code, message, remote_data=None)[source]

Indicates the desired reques was denied by the server

exception trex_exceptions.TRexRunFailedError(code, message, remote_data=None)[source]

Indicates that TRex has failed due to some reason. This Exception is used when TRex process itself terminates due to unknown reason

exception trex_exceptions.TRexWarning(code, message, remote_data=None)[source]

Indicates a warning from TRex server. When this exception raises it normally used to indicate required data isn’t ready yet