summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/analysis_tools.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/analysis_tools.cpp b/src/analysis_tools.cpp
index 778e713..bc8095e 100644
--- a/src/analysis_tools.cpp
+++ b/src/analysis_tools.cpp
@@ -1,6 +1,14 @@
#include "analysis_tools.hpp"
+class badcycleException: public std::exception
+{
+ virtual const char* what() const throw()
+ {
+ return "Could not find a valid cycle on the broken system.";
+ }
+} badcycleex;
+
template <class T>
bool is_shorter(const std::list<T> &l1, const std::list<T> &l2) {
return l1.size() < l2.size();
@@ -118,6 +126,6 @@ std::list<unsigned> find_minimal_crack(const Graph& G, const network& n) {
return cycles.front();
}
- exit(5);
+ throw badcycleex;
}