AKELA OpenVNA
 All Data Structures Functions Variables Typedefs Groups
ErrorExceptionMap-Py

This maps error return codes to the corresponding python exception. More...

Functions

def handleReturnCode
 Given a VNA-DLL return code, raise the corresponding python exception if the return-code is not ERR_OK. More...
 

Variables

dictionary Exception_Map
 

Detailed Description

This maps error return codes to the corresponding python exception.

Function Documentation

def VNA.vnalibrary.handleReturnCode (   code,
  message = "" 
)

Given a VNA-DLL return code, raise the corresponding python exception if the return-code is not ERR_OK.

One of the child-classes of VNA_Exception as dictated by the value of code (if code corresponds to an exception).

Otherwise, it simply returns with no exception thrown.

Parameters
codeThe return code from a DLL-call.
messageOptional, description added to raised exception.
Returns
Nothing.

Variable Documentation

dictionary Exception_Map
Initial value:
1 = {
2  ERR_BAD_ATTEN : vnaexceptions.VNA_Exception_Bad_Atten,
3  ERR_BAD_CAL : vnaexceptions.VNA_Exception_Bad_Cal,
4  ERR_BAD_HANDLE : vnaexceptions.VNA_Exception_Bad_Handle,
5  ERR_BAD_HOP : vnaexceptions.VNA_Exception_Bad_Hop,
6  ERR_BAD_PATH : vnaexceptions.VNA_Exception_Bad_Path,
7  ERR_BAD_PROM : vnaexceptions.VNA_Exception_Bad_Prom,
8  ERR_BYTES : vnaexceptions.VNA_Exception_Bytes,
9  ERR_FREQ_OUT_OF_BOUNDS : vnaexceptions.VNA_Exception_Freq_Out_Of_Bounds,
10  ERR_INTERRUPTED : vnaexceptions.VNA_Exception_Interrupted,
11  ERR_NO_RESPONSE : vnaexceptions.VNA_Exception_No_Response,
12  ERR_MISSING_IP : vnaexceptions.VNA_Exception_Missing_Ip,
13  ERR_MISSING_PORT : vnaexceptions.VNA_Exception_Missing_Port,
14  ERR_MISSING_HOP : vnaexceptions.VNA_Exception_Missing_Hop,
15  ERR_MISSING_ATTEN : vnaexceptions.VNA_Exception_Missing_Atten,
16  ERR_MISSING_FREQS : vnaexceptions.VNA_Exception_Missing_Freqs,
17  ERR_PROG_OVERFLOW : vnaexceptions.VNA_Exception_Prog_Overflow,
18  ERR_SOCKET : vnaexceptions.VNA_Exception_Socket,
19  ERR_TOO_MANY_POINTS : vnaexceptions.VNA_Exception_Too_Many_Points,
20  ERR_WRONG_STATE : vnaexceptions.VNA_Exception_Wrong_State,
21 
22 }