From 3bf17c12f738319abd5feaa31caef8940f0b4001 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 4 Jul 2021 09:32:29 +0200 Subject: [PATCH] arcm:: hr_archimedean_error as an exception --- archimedean.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/archimedean.cpp b/archimedean.cpp index e34424bc..3a24d4a4 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -15,6 +15,10 @@ EX namespace arcm { EX bool in() { return cgflags & qARCHI; } #if HDR +struct hr_archimedean_error : hr_exception { + hr_archimedean_error(string _s) : hr_exception(_s) {} + }; + struct archimedean_tiling { int coloring; @@ -873,11 +877,11 @@ void connectHeptagons(heptspin hi, heptspin hs) { } if(hi.peek()) { DEBB(DF_GEOM, (format("ERROR: already connected left\n"))); - exit(1); + throw hr_archimedean_error("Archimedean error: already connected left"); } if(hs.peek()) { DEBB(DF_GEOM, (format("ERROR: already connected right\n"))); - exit(1); + throw hr_archimedean_error("Archimedean error: already connected right"); } hi.at->c.connect(hi.spin, hs);