Updated ChangeLog and whitespace
[barry.git] / doc / Exceptions
blobb6807fa15007f7edd57a2d740ecd59c7f452ac1b
2 The Barry library has the following exception hierarchy:
4 - std::exception
5         - std::logic_error
6         - std::runtime_error
7                 - Barry::Error
8                         - Usb::Error
9                                 - Usb::Timeout
10                         - Barry::BadPassword
11                         - Barry::BadData
12                         - Barry::BadSize
13                         - Barry::ErrnoError
14                                 - Barry::ConfigFileError
15                         - Barry::BadPackedFormat
16                         - Barry::BadPacket
17                         - Barry::ConvertError
18                         - Barry::UnroutableReadError
19                         - Barry::BackupError
20                         - Barry::RestoreError
21                         - Barry::JDWP::Error
22                         - Barry::JDWP::Timeout
24 Usb::Error
25         All specific USB error exceptions will be derived from
26         this class.  Where possible, this class also stores the
27         specific return code from the libusb API, to allow
28         fine grained error handling.
30 Barry::Error
31         All specific Barry error exceptions will be derived from
32         this class.  This can be thrown from anywhere inside Barry.
34 std::bad_alloc
35         There is also the remote possibility that there will be memory
36         exceptions from a call to 'new'.  In that case, std::bad_alloc
37         will be thrown by the standard C++ libraries.  Barry does not
38         catch these errors.
40 std::logic_error
41         Assert-like errors will cause std::logic_error to be thrown.
42         Barry does sometimes throw these, but they should be be
43         exceedingly rare.
45 All of the above exceptions (from std, Barry, and Usb namespaces)
46 are derived from std::exception, so they can all be caught in one
47 statement for the efficient and lazy. :-)