Skip to main content

Module errors

Module errors 

Source
Available on non-crate feature lock only.
Expand description

CSPICE error handling.

§Description

CSPICE keeps its own error state. By default, a routine that fails prints a long report to the screen and terminates the process — fine for a Fortran program, fatal for a library. Calling quiet once, at start-up, switches the toolkit to the "RETURN" action with no output device: failing routines then simply return, and check turns that state into a Rust Result.

spice::errors::quiet();

spice::furnsh("does-not-exist.tm");
if let Err(error) = spice::errors::check() {
    eprintln!("{error}");
}

check resets the error state, so the next call starts from a clean slate.

See the C documentation.

Structs§

Error
An error reported by CSPICE.

Functions§

check
Turn the current CSPICE error state into a Result, clearing it on the way.
erract
Retrieve or set the default error action.
errdev
Retrieve or set the name of the current output device for error messages.
errprt
Retrieve or set the list of error message items to be output.
failed
Whether CSPICE is in an error state.
getmsg
Retrieve one of the error messages: "SHORT", "EXPLAIN" or "LONG".
loud
Restore the CSPICE defaults: report to the screen, then abort the process.
qcktrc
Return the traceback of the routines that were active when the error was signalled.
quiet
Stop CSPICE from writing to the screen and from terminating the process on error.
reset
Clear the CSPICE error state.