Program Listing for File exception.h¶
↰ Return to documentation for file (include/amici/exception.h
)
#ifndef amici_exception_h
#define amici_exception_h
#include "amici/defines.h" // necessary for realtype
#include <exception>
#include <array>
namespace amici {
class AmiException : public std::exception {
public:
explicit AmiException(char const* fmt, ...);
const char* what() const noexcept override;
const char *getBacktrace() const;
void storeBacktrace(int nMaxFrames);
private:
std::array<char, 500> msg_;
std::array<char, 500> trace_;
};
class CvodeException : public AmiException {
public:
CvodeException(int error_code, const char *function);
};
class IDAException : public AmiException {
public:
IDAException(int error_code, const char *function);
};
class IntegrationFailure : public AmiException {
public:
IntegrationFailure(int code, realtype t);
int error_code;
realtype time;
};
class IntegrationFailureB : public AmiException {
public:
IntegrationFailureB(int code, realtype t);
int error_code;
realtype time;
};
class SetupFailure : public AmiException {
public:
explicit SetupFailure(const char *msg) : AmiException(msg) {}
};
class NewtonFailure : public AmiException {
public:
NewtonFailure(int code, const char *function);
int error_code;
};
} // namespace amici
#endif /* amici_exception_h */