summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2019-03-19 14:30:53 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2019-03-19 14:30:53 -0400
commitea4113e623170692a469f152752f9d583eecfedd (patch)
tree8bcf79dc7dfc005f682997c2a5a260270f5a3b4c /src
parentaad91479b4e32ca090d7cf36e5b3b30d5458a7f4 (diff)
downloadfuse_networks-ea4113e623170692a469f152752f9d583eecfedd.tar.gz
fuse_networks-ea4113e623170692a469f152752f9d583eecfedd.tar.bz2
fuse_networks-ea4113e623170692a469f152752f9d583eecfedd.zip
removed exit errors in favor of throws
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;
}