rpm/barry.spec file now assumes gui and opensync, with conditional checks
[barry/pauldeden.git] / doc / Exceptions
blobb94399d680c80ba055cd6b9b465dbb723f4cc550
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::BadSize
12                         - Barry::ErrnoError
14 Usb::Error
15         All specific USB error exceptions will be derived from
16         this class.  Where possible, this class also stores the
17         specific return code from the libusb API, to allow
18         fine grained error handling.
20 Barry::Error
21         All specific Barry error exceptions will be derived from
22         this class.  This can be thrown from anywhere inside Barry.
24 std::bad_alloc
25         There is also the remote possibility that there will be memory
26         exceptions from a call to 'new'.  In that case, std::bad_alloc
27         will be thrown by the standard C++ libraries.  Barry does not
28         catch these errors.
30 std::logic_error
31         Assert-like errors will cause std::logic_error to be thrown.
32         Barry does sometimes throw these, but they should be be
33         exceedingly rare.
35 All of the above exceptions (from std, Barry, and Usb namespaces)
36 are derived from std::exception, so they can all be caught in one
37 statement for the efficient and lazy. :-)