Exception Handling
- Last UpdatedNov 24, 2023
- 1 minute read
The Vitesse Utility interface uses exception handling. This means that if a run time error occurs an exception is set. The exception can be caught using the "try - except" construct of the Python language. The type of error can then be examined by checking the value of kcs_util.error. The exception is also displayed in the Vitesse Log window which is available by the Vitesse Log Window command and can optionally be written to the log file. The meaning of the exception can be found in the description of the corresponding function.
The default error is kcs_Error. If no specific exception occurs, this error is set. Note that the kcs_Error exception is a general exception and will not be further described below. .
|
Example: |
|---|
|
import kcs_util env = 'SB_PYTHON' try: cur_value = kcs_util.TB_environment_get(env) except: print kcs_util.error |