From ea4113e623170692a469f152752f9d583eecfedd Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 19 Mar 2019 14:30:53 -0400 Subject: removed exit errors in favor of throws --- src/analysis_tools.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') 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 bool is_shorter(const std::list &l1, const std::list &l2) { return l1.size() < l2.size(); @@ -118,6 +126,6 @@ std::list find_minimal_crack(const Graph& G, const network& n) { return cycles.front(); } - exit(5); + throw badcycleex; } -- cgit v1.2.3-70-g09d2