@cindex error handling
The error handling subroutines are available from Fortran, with
exception of the macros @code{GSL_ERROR} and  @code{GSL_ERROR_VAL}. 
A user-defined error handler can be defined either in C or using a 
Fortran function with the @code{bind(c)} attribute. Here is the 
description of the required interface:
@verbatiminclude codefrags/errhand.f90
@noindent
An object of type @code{fgsl_error_handler_t} is returned by the 
constructor @code{fgsl_error_handler_init(errhand)}, which takes 
a subroutine with the interface described above as its argument.
The subroutine @code{fgsl_error(reason, file, line, errno)} works
in an analogous manner as the C version. If the Fortran preprocessor is 
supported, it should be possible to use the macros @code{__FILE__}
and @code{__LINE__} in the above call. Once not needed any more, the
error handler object can be deallocated by calling the subroutine
@code{fgsl_error_handler_free} with itself as its only argument.
Note that the function  @code{fgsl_strerror} returns a string
of length @code{fgsl_strmax}.
