Synopsis
Returns the ChIPS error report "verbosity" setting presently in effect.
Syntax
get_error_verbosity()
Description
The get_error_verbosity command returns an indicator specifying the level of detail printed when errors are detected in ChIPS. This command is part of the advanced ChIPS module; refer to "ahelp chips" for information. To load the module:
from pychips.advanced import *
Example
chips> from pychips.advanced import * chips> get_error_verbosity() 2 chips> set_preference("line.color", "x") chips ERROR: The color 'x' is unknown or not supported chips> set_error_verbosity(0) 0 chips> set_preference ("line.color", "x") 37 chips> set_error_verbosity(1) chips> set_preference ("line.color", "x") chips ERROR: The color 'x' is unknown or not supported
The advanced command module is loaded so that we have access to the get_error_verbosity and set_error_verbosity commands. We then use these commands to vary the error verbosity level and see how it influences the behavior of ChIPS.
Error Levels
Error Verbosity Levels
Feature | Level 0 | Level 1 | Level 2 | Level 3 |
---|---|---|---|---|
Returns numeric error value | Yes | No | No | No |
Prints out warning messages | No | No | Yes | Yes |
Prints out error messages | No | Yes | Yes | Yes |
Removes messages with duplicate text | N/A | Yes | Yes | No |
Shows object hierarchy where error occurred | N/A | No | No | Yes |
A more complete explanation of the levels:
- level = 0: error messages are not echoed to the screen. The error message is still added to an internal stack and may be retrieved using the get_errors command ("ahelp get_errors"). This level returns a numeric error value. A returned value of 0 indicates that the routine succeeded; nonzero values generally indicate a failure.
- level = 1: display an error string instead of an error value. Only unique errors are printed, e.g. 'set_curve_linecolor("all","grene")' will produce a single error, regardless of how many curves the call fails on. A return value is not provided, and warning messages are not printed.
- level = 2: similar to level 1, but warning messages are supported along with the errors.
- level = 3: the most verbose level of error reporting. Errors and warnings are handled as exceptions resulting in a message being echoed to the client window. Duplicate messages are not filtered. In addition, each error message contains a mapping which indicates the hierarchy of objects where the error occured.
For instance, a failed label command might produce:
chips ERROR: The label size value (-5) must be between 1 and 100 {object: win1->frm1->lbl1} chips ERROR: The label size value (-5) must be between 1 and 100 {object: win1->frm1->lbl2}
Bugs
See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.