Next: Error Handlers, Previous: Error Reporting, Up: Error Handling
The error code numbers returned by library functions are defined in the
file gsl_errno.h. They all have the prefix GSL_
and
expand to non-zero constant integer values. Many of the error codes use
the same base name as the corresponding error code in the C library. Here are
some of the most common error codes,
Domain error; used by mathematical functions when an argument value does not fall into the domain over which the function is defined (like EDOM in the C library)
Range error; used by mathematical functions when the result value is not representable because of overflow or underflow (like ERANGE in the C library)
No memory available. The system cannot allocate more virtual memory because its capacity is full (like ENOMEM in the C library). This error is reported when a GSL routine encounters problems when trying to allocate memory with
malloc
.
Invalid argument. This is used to indicate various kinds of problems with passing the wrong argument to a library function (like EINVAL in the C library).
The error codes can be converted into an error message using the
function gsl_strerror
.