common.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. // $Id$
  15. #ifndef __COMMON_H
  16. #define __COMMON_H 1
  17. #include <stdexcept>
  18. #include <string>
  19. /// An exception class that is thrown in an unrecoverable error condition.
  20. ///
  21. /// This exception should not be caught except at the highest level of
  22. /// the application only for terminating the program gracefully, and so
  23. /// it cannot be a derived class of \c isc::Exception.
  24. class FatalError : public std::runtime_error {
  25. public:
  26. FatalError(const std::string& what) : std::runtime_error(what)
  27. {}
  28. };
  29. #endif // __COMMON_H
  30. // Local Variables:
  31. // mode: c++
  32. // End: