chiark / gitweb /
Reunify exception throwing.
authorRoss Younger <onyx-commits@impropriety.org.uk>
Fri, 1 Feb 2013 20:43:54 +0000 (09:43 +1300)
committerRoss Younger <onyx-commits@impropriety.org.uk>
Fri, 1 Feb 2013 20:43:54 +0000 (09:43 +1300)
benchmark/benchmark.cpp
libfractal/Fractal-internals.h
libfractal/Fractal.cpp
test/FractalKAT.cpp

index 8e20239..cca4653 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "Fractal.h"
 #include <hayai/hayai.hpp>
+#include "Exception.h"
 
 using namespace Fractal;
 
@@ -30,7 +31,7 @@ public:
        virtual void SetUp() {
                FractalCommon::load_base();
                impl = FractalCommon::registry.get("Mandelbrot");
-               if (impl==0) throw "Cannot find my fractal!";
+               if (impl==0) THROW(BrotFatalException, "Cannot find my fractal!");
 
                /* A point (found by experiment) that's in the set but not
                 * in the special-case cut-off regions */
index f5954ef..612ab35 100644 (file)
@@ -19,6 +19,7 @@
 #define FRACTAL_INTERNALS_H_
 
 #include "FractalMaths.h"
+#include "Exception.h"
 
 namespace Fractal {
 
@@ -61,7 +62,7 @@ public:
                switch(type) {
                        ALL_MATHS_TYPES(DO_PLOT)
                case Maths::MathsType::MAX:
-                       throw "Unhandled value type";
+                       THROW(BrotFatalException, "Unhandled maths type!");
                }
        }
 };
index 2fdb88d..3c4b746 100644 (file)
@@ -21,6 +21,7 @@
 #include <vector>
 #include <glib.h>
 #include "Fractal.h"
+#include "Exception.h"
 #include "Fractal-internals.h"
 
 using namespace Fractal;
@@ -87,7 +88,7 @@ const char* Maths::name(Maths::MathsType t) {
                if (it->val == t)
                        return it->name;
        }
-       throw "Unhandled maths type!";
+       THROW(BrotFatalException, "Unhandled maths type!");
 }
 
 Value Maths::min_pixel_size(MathsType t) {
@@ -95,7 +96,7 @@ Value Maths::min_pixel_size(MathsType t) {
                if (it->val == t)
                        return it->min_pixel_size;
        }
-       throw "Unhandled maths type!";
+       THROW(BrotFatalException, "Unhandled maths type!");
 }
 
 Value Maths::smallest_min_pixel_size() {
index ef6fbab..1a151b9 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <gtest/gtest.h>
 #include "Fractal.h"
+#include "Exception.h"
 
 using namespace Fractal;
 
@@ -44,7 +45,7 @@ public:
        virtual void SetUp() {
                FractalCommon::load_base();
                impl = FractalCommon::registry.get("Mandelbrot");
-               if (impl==0) throw "Cannot find my fractal!";
+               if (impl==0) THROW(BrotFatalException,"Cannot find my fractal!");
        }
        virtual void TearDown() {
                FractalCommon::unload_registry();