Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: plugins - Tool Up: misc - Module Previous: note - Function


throw - Function



Package utility
Module misc


Send a SEVERE message, then fail


Synopsis
throw(..., origin, postcli)

include "note.g"



Synopsis
throw(..., origin='Glish')(..., origin, postcli)



Description
It is often useful to be able to both print an error message (to the logger if it is defined, otherwise to the terminal), and then return a fail. This function implements that idiom.

The priority is always set to SEVERE.



Arguments

... in components of the message
    Allowed: string
origin in source of the message
    Allowed: string
    Default: 'Glish'
postcli in Show message in CLI window too?
    Allowed: Bool
    Default: F


Returns
fail with the message in it



Example
myfunc := function(x) {
    if (!is_numeric(x))
        return throw('I can only deal with numeric values of x, not ', 
                      type_name(x), origin='myfunc');
}



See Also
1.
The AIPS++logger
2.
note





next up previous contents index
Next: plugins - Tool Up: misc - Module Previous: note - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15