1#ifndef CYCLUS_SRC_ERROR_H_
2#define CYCLUS_SRC_ERROR_H_
12class Error :
public std::exception {
104extern std::map<Warnings, unsigned int>
warn_count;
115void Warn(
const std::string& msg) {
137 }
else if (
cnt == 0) {
139 std::cerr <<
"Further " <<
warn_prefix[
T] <<
"s will be suppressed.\n";
For failed casts that shouldn't.
CastError(std::string msg)
For depricating API until a next major release.
DepricationError(std::string msg)
A generic mechanism to manually manage exceptions.
void msg(std::string msg)
sets the error message
virtual const char * what() const
Returns the error message associated with this Error.
std::string msg() const
Returns the error message associated with this Error.
Error()
Constructs a new Error with the default message.
std::string msg_
The message associated with this exception.
for failed reading/writing to files, network connections, etc..
For failed retrieval/insertion of key-based data into/from data structures.
KeyError(std::string msg)
For failed object state expectations.
StateError(std::string msg)
For validating files received via IO.
ValidationError(std::string msg)
For values that are too big, too small, etc.
ValueError(std::string msg)
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
bool warn_as_error
Flag for throwing an error when a warning happens.
unsigned int warn_limit
This is maximum number of times to issue a warning of each kind.
std::map< Warnings, std::string > warn_prefix
The number of warnings issues for each kind.
std::map< Warnings, std::string > warn_prefixes()
Creates the warning prefixes mapping.
std::map< Warnings, unsigned int > warn_count
The number of warnings issues for each kind.
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters
void Warn(const std::string &msg)
Issue a warning with the approriate message, accoring to the current warning settings.
@ PENDING_DEPRECATION_WARNING