2.3 Exception handling

GSL provides a selectable error handler, that is called for occuring errors (like domain errors, division by zero, etc. ). This is switched off. Instead each wrapper function will check the error return value and in case of error an python exception is created.

Here is a python level example:

import pygsl.histogram
import pygsl.errors
except pygsl.errors.gsl_Error,err:
   print err
Will result
input domain error: index i lies outside valid range of 0 .. nx - 1

An exception are ufuncs in the testings.sf module (see section12.2).