Error functions

The following group of functions defines the behavior of the library when errors occur during the execution.

Usage

The following examples, that can be found in the directory examples of the library sources, show the typical usage of this group of functions.

The example in Octave/Matlab language is mexerror.m.

The following example shows how to define a custom error handler function.

%-----------------------------------------------------------------
% custom error handler
%-----------------------------------------------------------------
function myhandler(msg)
    disp('The calceph calls the function myhandler');
    disp('The error message is :')
    disp('----------------------')
    disp(msg)
    disp('----------------------')
    disp('The error handler returns')
end

% set the  error handler to use my own callback
calceph_seterrorhandler(3, 'myhandler')

% open the ephemeris file
peph = CalcephBin.open('example1.dat')