This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: problems with error handling
- From: Daniel Rohe <d dot rohe at fkf dot mpg dot de>
- To: Achim Gaedke <Achim dot Gaedke at uni-koeln dot de>
- Cc: gsl discussion list <gsl-discuss at sources dot redhat dot com>
- Date: Sun, 07 Apr 2002 16:42:48 +0200
- Subject: Re: problems with error handling
- References: <3CB03520.4030905@fkf.mpg.de> <3CB05975.1B39051@uni-koeln.de>
Achim Gaedke wrote:
>Daniel Rohe schrieb:
>
>>...
>>
>>but all that happens if the error occurs is
>>
>> >gsl: qagp.c:504: ERROR: integral is divergent, or slowly convergent
>>Abort
>>
>>I guess I'm making a silly mistake once more. can anyone give me a hint?
>>
>No, not really. Here is the hint: The default error handling is: (see
>gsl/err/error.c)
>
>void
>gsl_error (const char * reason, const char * file, int line, int gsl_errno)
>{
> if (gsl_error_handler)
> {
> (*gsl_error_handler) (reason, file, line, gsl_errno);
> return ;
> }
>
> gsl_stream_printf ("ERROR", file, line, reason);
> abort ();
>}
>
>That is the reason. More can be read in gsl-Reference: Chapter Error handling
>
I did look at this chapter actually, and I copied the following example:
start quote from gsl-manual:
Here is an example of some code which checks the return value of a
function where an error might be reported,
int status = gsl_fft_complex_radix2_forward (data, n);
if (status) {
if (status == GSL_EINVAL) {
fprintf (stderr, "invalid argument, n=%d\n", n);
} else {
fprintf (stderr, "failed, gsl_errno=%d\n",
status);
}
exit (-1);
}
end quote.
can you think of some solution to the problem?
thanks for the help,
daniel