Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: December 2013

URL: http://cxc.harvard.edu/chips/ahelp/set_error_verbosity.html
AHELP for CIAO 4.9 ChIPS v1

set_error_verbosity

Context: errors

Synopsis

Controls the amount of error information returned by ChIPS.

Syntax

set_error_verbosity(level)

Description

The function arguments.

Argument Description
level The level of error handling (an integer in the range 0 to 3 inclusive; values greater than 3 are taken to be 3).

The set_error_verbosity command controls the amount 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 1

chips> set_error_verbosity(0)
0
chips> set_preference("color", "red")
35

Set the error verbosity level to 0, so that errors are returned as numeric error code values rather than as strings.

Example 2

chips> set_error_verbosity(3)

Set the error verbosity level to print detailed information when errors occur.

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.

See Also

errors
clear_errors, get_error_count, get_error_types, get_error_verbosity, get_errors

Last modified: December 2013
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email:   cxchelp@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2017. All rights reserved.