Acspy.Common.ErrorTrace
index
/alma/ACS-2016.6/ACSSW/lib/python/site-packages/Acspy/Common/ErrorTrace.py

Python helper class for ACSErr.ErrorTrace

 
Modules
       
ACSErr
ACSLog
acstime
logging

 
Classes
       
ACSErr.ErrorTrace(omniORB.StructBase)
ErrorTrace(ACSErr.ErrorTrace, ErrorTraceHelper)
__builtin__.object
ErrorTraceHelper
ErrorTrace(ACSErr.ErrorTrace, ErrorTraceHelper)

 
class ErrorTrace(ACSErr.ErrorTrace, ErrorTraceHelper)
    This class is an implementation of ACSErr.ErrorTrace that also provides
the helper class methods defined in ErrorTraceHelper directly. Quite
useful.
 
 
Method resolution order:
ErrorTrace
ACSErr.ErrorTrace
omniORB.StructBase
ErrorTraceHelper
__builtin__.object

Methods defined here:
__init__(self, error_type, error_code, exception=None, description='None', nvSeq=None, level=3, severity=None, sourceobject='')
Parameters:
- error_type is the error type (a long)
- error_code is the error code (a long)
- exception is a previous exception from the ACS Error System, or a Python 
native exception, in which case, an ErrorTrace will be constructed. The traceback
should be ok in most cases, but if you find that it isn't, a possible workaround is
converting the python exception to an ACS exception using pyExceptionToCORBA()
before passing it to an ACSError constructor. Remember, that if you don't use 
pyExceptionToCORBA(), if 
you are dealing with a native exception, you must pass create=1 to the ACSError 
constructor.
- description is a stringified description of the errror
- nvSeq is a name-value sequence describing the error condition. Each value
should be of the type ACSErr.NameValue
- level is an offset from stack()
- severity is the severity of the error

Methods inherited from omniORB.StructBase:
__repr__(self)

Data descriptors inherited from omniORB.StructBase:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from ErrorTraceHelper:
Print(self)
Prints errortrace information to standard out.
 
Parameters: None
 
Returns: Nothing
 
Raises: Nothing
addData(self, name, value)
Adds data to the current error
 
Parameters: name and value will both be converted to strings.
 
Returns: Nothing
 
Raises: Nothing
errorTraceToString(self, error_trace, ws)
Converts an error trace to a human-readable string.
 
Parameters: error_trace is an errortrace
ws is whitespace
 
Returns: Nothing
 
Raises: Nothing
getData(self, name)
Gets previously set data from the ErrorTrace.
 
Parameters: name of the data as defined by the addData method
 
Returns: a list of previously set data (stringified) with the matching
name. This list can be empty if there are no matches
 
Raises: Nothing
getDescription(self)
Returns copy of description of current error. 
 
Parameters: None
 
Returns: Nothing
 
Raises: Nothing
getErrorCode(self)
Returns error code
 
Parameters: None
 
Returns: error code
 
Raises: Nothing
getErrorTrace(self)
Pure virtual. Method should return an instance of ACSErr.ErrorTrace
getErrorType(self)
Returns error type
 
Parameters: None
 
Returns: error type
 
Raises: Nothing
getFileName(self)
Returns file name information of the error
 
Parameters: None
 
Returns: filename
 
Raises: Nothing
getHostName(self)
Returns host name information of the error
 
Parameters: None
 
Returns: hostname
 
Raises: Nothing
getLineNumber(self)
Returns line number information of the error
 
Parameters: None
 
Returns: line number
 
Raises: Nothing
getNext(self)
Moves to the next errortrace element and returns a reference to it.
 
Parameters: None
 
Returns: the next errortrace element or None if it does not exist
 
Raises: Nothing
getProcess(self)
Returns process information of the error. Its name or process ID.
 
Parameters: None
 
Returns: Process ID
 
Raises: Nothing
getRoutine(self)
Returns routine information of the error
 
Parameters: None
 
Returns: routine name
 
Raises: Nothing
getSeverity(self)
Returns error severity
 
Parameters: None
 
Returns: Severity
 
Raises: Nothing
getThread(self)
Returns thread information of the error. The name of thread or its ID.
 
Parameters: None
 
Returns: Thread ID
 
Raises: Nothing
getTimeStamp(self)
Returns time stamp of the error in 100th of nanoseconds.
 
Parameters: None
 
Returns: time stamp
 
Raises: Nothing
isOK(self)
Returns 1 if errortrace does not represent error otherwise 0.
 
Parameters: None
 
Returns: 0 or 1
 
Raises: Nothing
log(self, logger, priority=ACS_LOG_ERROR)
Logs errortrace information into the ACS logging system.
 
Parameters:
- priorty which will be used for logging the error
 
Returns: Nothing
 
Raises: Nothing
printET(self, error_trace, ws)
Prints one error trace to standard out.
 
Parameters: et is an errortrace
ws is whitespace
 
Returns: Nothing
 
Raises: Nothing
setData(self, name, value)
Sets data within the ErrorTrace, adding it if it has not been
previously set.
 
Parameters: name and value will both be converted to strings.
 
Returns: Nothing
 
Raises: Nothing
setError(self, error_code=None, error_type=None)
Sets the error type/code
 
Parameters: self-explanatory
 
Returns: Nothing
 
Raises: ValueError if invalid parameters are given
setFileName(self, file_name)
Sets file name
 
Parameters: name of the file
 
Returns: Nothing
 
Raises: Nothing
setLineNumber(self, line_number)
Sets line number
 
Parameters: the line number
 
Returns: Nothing
 
Raises: Nothing
setSeverity(self, severity)
Sets error severity
 
Parameters: severity of the error
 
Returns: Nothing
 
Raises: Nothing
setTimeStamp(self, time)
Sets time stamp of the error in 100th of nanoseconds.
 
Parameters: the time stamp of the error
 
Returns: Nothing
 
Raises: Nothing

 
class ErrorTraceHelper(__builtin__.object)
    Helper class for objects containing an instance of an ACSErr.ErrorTrace
To be useful, the abstract getErrorTrace method must be implemented or 
one needs to provide an ACSErr.ErrorTrace to the constructor.
 
  Methods defined here:
Print(self)
Prints errortrace information to standard out.
 
Parameters: None
 
Returns: Nothing
 
Raises: Nothing
__init__(self, error_trace=None)
Constructor
 
Parameters: error_trace is an instance of ACSErr.ErrorTrace. While
this parameter is optional, if it is not provided the developer
must override the getErrorTrace method to return an 
ACSErr.ErrorTrace
addData(self, name, value)
Adds data to the current error
 
Parameters: name and value will both be converted to strings.
 
Returns: Nothing
 
Raises: Nothing
errorTraceToString(self, error_trace, ws)
Converts an error trace to a human-readable string.
 
Parameters: error_trace is an errortrace
ws is whitespace
 
Returns: Nothing
 
Raises: Nothing
getData(self, name)
Gets previously set data from the ErrorTrace.
 
Parameters: name of the data as defined by the addData method
 
Returns: a list of previously set data (stringified) with the matching
name. This list can be empty if there are no matches
 
Raises: Nothing
getDescription(self)
Returns copy of description of current error. 
 
Parameters: None
 
Returns: Nothing
 
Raises: Nothing
getErrorCode(self)
Returns error code
 
Parameters: None
 
Returns: error code
 
Raises: Nothing
getErrorTrace(self)
Pure virtual. Method should return an instance of ACSErr.ErrorTrace
getErrorType(self)
Returns error type
 
Parameters: None
 
Returns: error type
 
Raises: Nothing
getFileName(self)
Returns file name information of the error
 
Parameters: None
 
Returns: filename
 
Raises: Nothing
getHostName(self)
Returns host name information of the error
 
Parameters: None
 
Returns: hostname
 
Raises: Nothing
getLineNumber(self)
Returns line number information of the error
 
Parameters: None
 
Returns: line number
 
Raises: Nothing
getNext(self)
Moves to the next errortrace element and returns a reference to it.
 
Parameters: None
 
Returns: the next errortrace element or None if it does not exist
 
Raises: Nothing
getProcess(self)
Returns process information of the error. Its name or process ID.
 
Parameters: None
 
Returns: Process ID
 
Raises: Nothing
getRoutine(self)
Returns routine information of the error
 
Parameters: None
 
Returns: routine name
 
Raises: Nothing
getSeverity(self)
Returns error severity
 
Parameters: None
 
Returns: Severity
 
Raises: Nothing
getThread(self)
Returns thread information of the error. The name of thread or its ID.
 
Parameters: None
 
Returns: Thread ID
 
Raises: Nothing
getTimeStamp(self)
Returns time stamp of the error in 100th of nanoseconds.
 
Parameters: None
 
Returns: time stamp
 
Raises: Nothing
isOK(self)
Returns 1 if errortrace does not represent error otherwise 0.
 
Parameters: None
 
Returns: 0 or 1
 
Raises: Nothing
log(self, logger, priority=ACS_LOG_ERROR)
Logs errortrace information into the ACS logging system.
 
Parameters:
- priorty which will be used for logging the error
 
Returns: Nothing
 
Raises: Nothing
printET(self, error_trace, ws)
Prints one error trace to standard out.
 
Parameters: et is an errortrace
ws is whitespace
 
Returns: Nothing
 
Raises: Nothing
setData(self, name, value)
Sets data within the ErrorTrace, adding it if it has not been
previously set.
 
Parameters: name and value will both be converted to strings.
 
Returns: Nothing
 
Raises: Nothing
setError(self, error_code=None, error_type=None)
Sets the error type/code
 
Parameters: self-explanatory
 
Returns: Nothing
 
Raises: ValueError if invalid parameters are given
setFileName(self, file_name)
Sets file name
 
Parameters: name of the file
 
Returns: Nothing
 
Raises: Nothing
setLineNumber(self, line_number)
Sets line number
 
Parameters: the line number
 
Returns: Nothing
 
Raises: Nothing
setSeverity(self, severity)
Sets error severity
 
Parameters: severity of the error
 
Returns: Nothing
 
Raises: Nothing
setTimeStamp(self, time)
Sets time stamp of the error in 100th of nanoseconds.
 
Parameters: the time stamp of the error
 
Returns: Nothing
 
Raises: Nothing

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
asctime(...)
asctime([tuple]) -> string
 
Convert a time tuple to a string, e.g. 'Sat Jun 06 16:26:11 1998'.
When the time tuple is not present, current time as returned by localtime()
is used.
gethostname(...)
gethostname() -> string
 
Return the current host name.
getpid(...)
getpid() -> pid
 
Return the current process id
gmtime(...)
gmtime([seconds]) -> (tm_year, tm_mon, tm_mday, tm_hour, tm_min,
                       tm_sec, tm_wday, tm_yday, tm_isdst)
 
Convert seconds since the Epoch to a time tuple expressing UTC (a.k.a.
GMT).  When 'seconds' is not passed in, convert the current time instead.

 
Data
        __revision__ = '$Id: ErrorTrace.py,v 1.1.1.1 2012/03/07 17:40:45 acaproni Exp $'
linesep = '\n'