55 MAiNGOException(
const std::string& errorMessage,
const std::exception& originalException)
65 const char*
what() const noexcept
override 76 std::ostringstream errorMessageStream;
87 completeErrorMessage << currentErrorMessage;
92 if (originalException) {
93 if (
typeid(*originalException).name() !=
typeid(*this).name()) {
94 completeErrorMessage <<
" Original exception type: " <<
typeid(*originalException).name() <<
": " << std::endl
97 completeErrorMessage << originalException->what() << std::endl;
103 if (nodeThatErrorOccurredIn) {
105 completeErrorMessage << std::endl
106 <<
" Exception was thrown while processing node no. " << nodeThatErrorOccurredIn->
get_ID() <<
":";
107 for (
size_t i = 0; i < lowerVarBounds.size(); i++) {
108 completeErrorMessage << std::endl
109 <<
" x(" << i <<
"): " << std::setprecision(16) << lowerVarBounds[i] <<
":" << upperVarBounds[i];
std::string _errorMessage
Definition: MAiNGOException.h:72
int get_ID() const
Function for querying the node ID.
Definition: babNode.h:100
Class representing a node in the Branch-and-Bound tree.
Definition: babNode.h:35
MAiNGOException(const std::string &errorMessage, const std::exception &originalException)
Definition: MAiNGOException.h:55
void _append_node_info_to_message(const babBase::BabNode *nodeThatErrorOccurredIn, std::ostringstream &completeErrorMessage)
Definition: MAiNGOException.h:101
MAiNGOException(const std::string &errorMessage, const std::exception &originalException, const babBase::BabNode &nodeThatErrorOccurredIn)
Definition: MAiNGOException.h:60
std::vector< double > get_lower_bounds() const
Function for querying the lower bounds on the optimization variables within this node.
Definition: babNode.h:90
void _append_original_exception_info_to_message(const std::exception *originalException, std::ostringstream &completeErrorMessage)
Definition: MAiNGOException.h:90
const char * what() const noexcept override
Definition: MAiNGOException.h:65
MAiNGOException(const std::string &errorMessage, const babBase::BabNode &nodeThatErrorOccurredIn)
Definition: MAiNGOException.h:50
void _construct_complete_error_message(const std::string &errorMessage, const std::exception *originalException, const babBase::BabNode *nodeThatErrorOccurredIn)
Definition: MAiNGOException.h:74
namespace holding all essentials of MAiNGO
Definition: aleModel.h:25
virtual ~MAiNGOException()=default
MAiNGOException & operator=(const MAiNGOException &)=default
MAiNGOException(const std::string &errorMessage)
Definition: MAiNGOException.h:45
std::vector< double > get_upper_bounds() const
Function for querying the upper bounds on the optimization variables within this node.
Definition: babNode.h:95
This class defines the exceptions thrown by MAiNGO.
Definition: MAiNGOException.h:35
void _append_current_error_message_to_message(const std::string ¤tErrorMessage, std::ostringstream &completeErrorMessage)
Definition: MAiNGOException.h:85