Previous: Data Scaling
Up: Basic FITSIO Conventions
Next: Variable-Length Array Facility in Binary Tables
Previous Page: Data Scaling
Next Page: Variable-Length Array Facility in Binary Tables

Error Status Values

The last parameter in nearly every subroutine is the returned error status value which is both an input and an output parameter. A returned positive value for this parameter indicates an error was detected; negative values are reserved for non-fatal warning messages. A listing of all the possible status code values is given at the end of this document. The FITSIO library uses an 'inherited status' convention for the status parameter which means that if a subroutine is called with a positive input value of the status parameter, then the subroutine will exit immediately without changing the value of the status parameter. Thus, if one passes the status value returned from each FITSIO routine as input to the next FITSIO subroutine, then whenever an error is detected all further FITSIO processing will cease. This convention can simplify the error checking in application programs because it is not necessary to check the value of the status parameter after every single FITSIO subroutine call. If, for example, a program contains a sequence of several FITSIO calls, one can just check the status value after the last call. Since the returned status values are generally distinctive, it should be possible to determine which subroutine originally returned the error status.

asterix@space.starlink
Wed Feb 16 08:18:45 GMT 1994