#
# = Error Handling
#
# == {}[link:index.html"name="1] Error codes
# The GSL routines report an error whenever they cannot perform the task
# requested of them. For example, a root-finding function would return a
# non-zero error code if could not converge to the requested accuracy,
# or exceeded a limit on the number of iterations. Situations like this
# are a normal occurrence when using any mathematical library and
# you should check the return status of the functions that you call.
#
# Whenever a routine reports an error the return value specifies the type of error.
# The return value is analogous to the value of the variable errno in the C library.
# The caller can examine the return code and decide what action to take, including
# ignoring the error if it is not considered serious.
#
# The error code numbers in GSL as <tt>GSL_EDOM</tt> are defined in Ruby/GSL
# as Ruby constants under the <tt>GSL</tt> module. Here are some of them:
# * <tt>GSL::EDOM</tt> - Domain error; used by mathematical functions when an
#   argument value does not fall into the domain over which the function is
#   defined (like <tt>EDOM</tt> in the C library)
# * <tt>GSL::ERANGE</tt> - Range error; used by mathematical functions when the
#   result value is not representable because of overflow or underflow
#   (like <tt>ERANGE</tt> in the C library)
# * <tt>GSL::ENOMEM</tt> - No memory available. The system cannot allocate more
#   virtual memory because its capacity is full (like <tt>ENOMEM</tt> in the
#   C library). This error is reported when a GSL routine encounters problems
#   when trying to allocate memory with malloc.
# * <tt>GSL::EINVAL</tt> - Invalid argument. This is used to indicate various
#   kinds of problems with passing the wrong argument to a library function
#   (like <tt>EINVAL</tt> in the C library).
#
# == {}[link:index.html"name="2] Error handler
# In Ruby/GSL, the default GSL error handler is replaced by an other one which calls
# <tt>rb_raise()</tt>. Thus whenever a GSL routine reports a fatal error,
# a Ruby Exception is generated.
#
# ---
# * GSL::set_error_handler(proc)
# * GSL::set_error_handler { |reason, file, line, errno| ... }
#
#   This replaces the Ruby/GSL default error handler by a user-defined handler
#   given by a Proc object <tt>proc</tt> or a block.
#
# {prev}[link:files/rdoc/use_rdoc.html]
# {next}[link:files/rdoc/math_rdoc.html]
#
# {Reference index}[link:files/rdoc/ref_rdoc.html]
# {top}[link:files/rdoc/index_rdoc.html]
#
