Logo
Telescience Resource Kit
TReK Python  5.4.0 ART
TrekError Class Reference

The TReK C++ was designed to return error codes. More...

Inherits Exception.

Public Member Functions

def TrekError (error_message: str, error_code: int -> None ) -> def 
 Class initializer. More...
 
def __str__ ( -> str ) -> def 
 Returns the TrekError converted to a string. More...
 
def find_error_code ( -> str ) -> def 
 Locate and print the text meaning of the error code. More...
 

Public Attributes

 message
 Trek Python error message.
 
 code
 Trek API error code.
 

Detailed Description

The TReK C++ was designed to return error codes.

The Python implementation instead will raise TrekError exceptions containing more information and the error code. Error code values and descriptions are documented in the TReK API. print_error_code() can retrieve a text description of the code.

Note
print_error_code() Locates and prints the code meaning and would impact performance in a fault tolerate implementation.

Constructor & Destructor Documentation

◆ TrekError()

(error_message : str 
error_code : int 
) -> None

Class initializer.

Parameters
[in]error_messagePython error message.
[in]error_codeTReK error code.

Member Function Documentation

◆ __str__()

() -> str

Returns the TrekError converted to a string.

Example:

my_error_str = str(trekerror)

◆ find_error_code()

() -> str

Locate and print the text meaning of the error code.

Note
Locates and returns the code meaning and would impact performance in a fault tolerate implementation.
Returns
Error code and message.