Belle II Software development
Exception.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#ifndef _Belle2_Exception_hh
9#define _Belle2_Exception_hh
10
11#include <exception>
12#include <string>
13
14namespace Belle2 {
20 class Exception : public std::exception {
21
22 public:
23 Exception();
24 Exception(const std::string&);
25 Exception(const std::string&, int err);
26#if __GNUC__ >= 7
27 virtual ~Exception() {}
28#else
29 virtual ~Exception() throw() {}
30#endif
31
32 public:
33#if __GNUC__ >= 7
34 virtual const char* what() const noexcept;
35#else
36 virtual const char* what() const throw();
37#endif
38 int err() const { return m_err; }
39
40 protected:
41 std::string m_comment;
42 int m_err;
43
44 };
45
47}
48
49#endif
Abstract base class for different kinds of events.