9#ifndef IMPKERNEL_EXCEPTION_H
10#define IMPKERNEL_EXCEPTION_H
12#include <IMP/kernel_config.h>
15#include "internal/static.h"
19IMPKERNEL_BEGIN_NAMESPACE
22typedef std::runtime_error ExceptionBase;
48class IMPKERNELEXPORT Exception
49#if !defined(SWIG) && !defined(IMP_DOXYGEN)
50 : public
std::runtime_error
54#if defined(SWIG) || defined(IMP_DOXYGEN)
55 const char *what()
const noexcept;
57 IMP_CXX11_DEFAULT_COPY_CONSTRUCTOR(Exception);
58 Exception(
const char *message);
59 ~Exception()
noexcept;
64#if !defined(SWIG) && !defined(IMP_DOXYGEN) && !IMP_KERNEL_HAS_LOG4CXX
65IMPKERNELEXPORT std::string get_context_message();
74 internal::check_level = std::min<CheckLevel>(tf,
CheckLevel(IMP_HAS_CHECKS));
101struct IMPKERNELEXPORT InternalException
102#if !defined(SWIG) && !defined(IMP_DOXYGEN)
103 : public
std::runtime_error
106 IMP_CXX11_DEFAULT_COPY_CONSTRUCTOR(InternalException);
107 InternalException(
const char *msg =
"Fatal error")
108 : std::runtime_error(msg) {}
109 ~InternalException()
noexcept;
122class IMPKERNELEXPORT UsageException
123#if !defined(SWIG) && !defined(IMP_DOXYGEN)
124 : public
std::runtime_error
128 IMP_CXX11_DEFAULT_COPY_CONSTRUCTOR(UsageException);
129 UsageException(
const char *t) : std::runtime_error(t) {}
130 ~UsageException()
noexcept;
136class IMPKERNELEXPORT ValueException :
public Exception {
138 IMP_CXX11_DEFAULT_COPY_CONSTRUCTOR(ValueException);
139 ValueException(
const char *t) : Exception(t) {}
140 ~ValueException()
noexcept;
146class IMPKERNELEXPORT TypeException :
public Exception {
148 IMP_CXX11_DEFAULT_COPY_CONSTRUCTOR(TypeException);
149 TypeException(
const char *t) : Exception(t) {}
150 ~TypeException()
noexcept;
156class IMPKERNELEXPORT IndexException :
public Exception {
158 IMP_CXX11_DEFAULT_COPY_CONSTRUCTOR(IndexException);
173class IMPKERNELEXPORT IOException : public Exception {
175 IMP_CXX11_DEFAULT_COPY_CONSTRUCTOR(IOException);
176 IOException(
const char *t) : Exception(t) {}
177 ~IOException()
noexcept;
188class IMPKERNELEXPORT ModelException :
public Exception {
190 IMP_CXX11_DEFAULT_COPY_CONSTRUCTOR(ModelException);
203class IMPKERNELEXPORT EventException : public Exception {
205 IMP_CXX11_DEFAULT_COPY_CONSTRUCTOR(EventException);
212IMPKERNEL_END_NAMESPACE
An exception that signifies some event occurred.
EventException(const char *t="")
Create exception with an error message.
An exception for a request for an invalid member of a container.
IndexException(const char *t)
Create exception with an error message.
An exception which is thrown when the Model has attributes with invalid values.
ModelException(const char *t)
Create exception with an error message.
Various compiler workarounds.
Basic enumeration types used by IMP.
void handle_error(const char *msg)
CheckLevel
Specify the level of runtime checks performed.
void set_check_level(CheckLevel tf)
Control runtime checks in the code.
CheckLevel get_check_level()
Get the current audit mode.