help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] [GSL] custom error handling


From: Max
Subject: [Help-gsl] [GSL] custom error handling
Date: Fri, 22 Aug 2008 11:10:54 +0800

Hello, 

I'm new to this list. So forgive me for my possible naive question.

I'm using custom error handling as per the method given in the manual.
My error hanlder is as follows to enable me handle the exceptions
with flexibility in my C++ program.

My simple program runs ok under debug mode, but not ok under release
mode.

I'm using GSL 1.8 ported to windows platform, with VS2003.

void my_gsl_error_handler (const char * reason,
                                                   const char * file,
                                                   int line,
                                                   int gsl_errno)
{
        throw gsl_errno;
}

try
{
        gsl_error_handler_t *old_handler = 
                gsl_set_error_handler (&my_gsl_error_handler);

        // call GSL routines

        gsl_set_error_handler (old_handler);
}
catch(int)
{
        // deal with the exceptions here
}


Thanks for any help.

                                
B/Rgds
Max





reply via email to

[Prev in Thread] Current Thread [Next in Thread]