exceptions.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright (C) 2011, 2012 Google Inc.
  2. //
  3. // This file is part of YouCompleteMe.
  4. //
  5. // YouCompleteMe is free software: you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation, either version 3 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // YouCompleteMe is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
  17. #ifndef EXCEPTIONS_H_3PHJ9YOB
  18. #define EXCEPTIONS_H_3PHJ9YOB
  19. #include <boost/exception/all.hpp>
  20. namespace YouCompleteMe {
  21. #define boost_throw(x) BOOST_THROW_EXCEPTION(x)
  22. // YouCompleteMe uses the "Exception types as semantic tags" idiom.
  23. // For more information, see this link:
  24. // http://www.boost.org/doc/libs/1_50_0/libs/exception/doc/exception_types_as_simple_semantic_tags.html
  25. /**
  26. * The common base for all exceptions.
  27. */
  28. struct ExceptionBase: virtual std::exception, virtual boost::exception {};
  29. /**
  30. * Thrown when a file does not exist.
  31. */
  32. struct ClangParseError : virtual ExceptionBase {};
  33. } // namespace YouCompleteMe
  34. #endif /* end of include guard: EXCEPTIONS_H_3PHJ9YOB */