SVN++ Exceptions

Exceptions in SVN++.

Exceptions in SVN++.

# Exceptions in SVN++

SVN++ uses exceptions for the following purposes:

- Reporting memory allocation failure; where Subversion's default hehaviour is to abort when an allocation from an APR pool fails, SVN++ throws an exception instead.
- Reporting errors; Subversion's error messages are wrapped in exceptions.
- Reporting cancelled operations; an operation that was cancelled from user code will report this by throwing a specific exception type.
- Terminating iteration; user-level callbacks may throw a specific exception type to cancel an ongoing operation that is generating the callback messages. Other exceptions from user-level callbacks will be propagated back to the calling application.

The SVN++ implementation will also throw standard exceptions when appropriate. Their use is documented in the relevant modules.

## Exception Hierarchy

All SVN++ exceptions are ultimately derived from `std::exception`.

- std::exception
  - std::bad_alloc
    - apache::subversion::svnxx::allocation_failed
      Thrown when memory cannot be allocated from an APR pool
  - std::runtime_error
    - apache::subversion::svnxx::error
      Thrown when an operation failed (see svn_error_t)
      - apache::subversion::svnxx::cancelled
        Thrown when an operation was cancelled, including by the user code throwing a `stop_iteration` exception (see below)
  - apache::subversion::svnxx::stop_iteration
    Thrown by user callbacks to terminate iteration