Updated root README file
[barry.git] / doc / Exceptions
blob0342a2ca021e0a3ead5b59f7bc2fcf83b612f0db
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::BackupError
19                         - Barry::RestoreError
20                         - Barry::JDWP::Error
21                         - Barry::JDWP::Timeout
23 Usb::Error
24         All specific USB error exceptions will be derived from
25         this class.  Where possible, this class also stores the
26         specific return code from the libusb API, to allow
27         fine grained error handling.
29 Barry::Error
30         All specific Barry error exceptions will be derived from
31         this class.  This can be thrown from anywhere inside Barry.
33 std::bad_alloc
34         There is also the remote possibility that there will be memory
35         exceptions from a call to 'new'.  In that case, std::bad_alloc
36         will be thrown by the standard C++ libraries.  Barry does not
37         catch these errors.
39 std::logic_error
40         Assert-like errors will cause std::logic_error to be thrown.
41         Barry does sometimes throw these, but they should be be
42         exceedingly rare.
44 All of the above exceptions (from std, Barry, and Usb namespaces)
45 are derived from std::exception, so they can all be caught in one
46 statement for the efficient and lazy. :-)