Commit 9d5ca224 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

the great RAISE macro refactoring

parent 2feb64f0
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -245,7 +245,7 @@ void AreaChart3D<TX, TY, TZ>::addSeries(Series3D<TX, TY, TZ>* series) {
    area.line_width = std::stod(series->getProperty(Series::P_LINE_WIDTH));
  } catch (const std::exception& e) {
    RAISE(
        util::RuntimeException,
        kRuntimeError,
        "invalid line width: %s",
        series->getProperty(Series::P_LINE_WIDTH).c_str());
  }
@@ -254,7 +254,7 @@ void AreaChart3D<TX, TY, TZ>::addSeries(Series3D<TX, TY, TZ>* series) {
    area.point_size = std::stod(series->getProperty(Series::P_POINT_SIZE));
  } catch (const std::exception& e) {
    RAISE(
        util::RuntimeException,
        kRuntimeError,
        "invalid point size: %s",
        series->getProperty(Series::P_POINT_SIZE).c_str());
  }
@@ -424,7 +424,7 @@ AnyDomain* AreaChart3D<TX, TY, TZ>::getDomain(
      return y_domain_.get();

    case AnyDomain::DIM_Z:
      RAISE(util::RuntimeException, "AreaChart3D does not have a Z domain");
      RAISE(kRuntimeError, "AreaChart3D does not have a Z domain");
      return nullptr;
  }
}
+3 −3
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ void BarChart3D<TX, TY, TZ>::addSeries(Series3D<TX, TY, TZ>* series) {

    if (!(point.y() <= point.z())) {
      RAISE(
          util::RuntimeException,
          kRuntimeError,
          "BarChart error: invalid point in series. Z value must be greater "
          "or equal to Y value for all points");
    }
@@ -340,7 +340,7 @@ void BarChart3D<TX, TY, TZ>::render(
    RenderTarget* target,
    Viewport* viewport) const {
  if (data_.size() == 0) {
    RAISE(util::RuntimeException, "BarChart3D#render called without any data");
    RAISE(kRuntimeError, "BarChart3D#render called without any data");
  }

  SeriesJoin3D<TX, TY, TZ> const* data;
@@ -515,7 +515,7 @@ template <typename TX, typename TY, typename TZ>
const std::string& BarChart3D<TX, TY, TZ>::seriesColor(
    size_t series_index) const {
  if (series_index > series_.size()) {
    RAISE(util::RuntimeException, "invalid series index");
    RAISE(kRuntimeError, "invalid series index");
  }

  return series_[series_index]->getProperty(Series::P_COLOR);
+2 −2
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ public:
    if (is_logarithmic_) {
      if (min_value_ < 0) {
        RAISE(
            util::RuntimeException,
            kRuntimeError,
            "negative value is outside of logarithmic domain");
      }

@@ -86,7 +86,7 @@ public:
    if (is_logarithmic_) {
      if (max_value_ < 0) {
        RAISE(
            util::RuntimeException,
            kRuntimeError,
            "negative value is outside of logarithmic domain");
      }

+2 −2
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ public:
        value);

    if (index < 1) {
      RAISE(util::RuntimeException, "can't scale value");
      RAISE(kRuntimeError, "can't scale value");
    }

    double cardinality = (double) categories_.size();
@@ -54,7 +54,7 @@ public:
        value);

    if (index < 1) {
      RAISE(util::RuntimeException, "can't scale value");
      RAISE(kRuntimeError, "can't scale value");
    }

    auto cardinality = (double) categories_.size();
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ T* DomainProvider::getAs() const {
  T* domain = dynamic_cast<T*>(domain_);

  if (domain == nullptr) {
    RAISE(util::RuntimeException, "can't convert domain to requested type");
    RAISE(kRuntimeError, "can't convert domain to requested type");
  }

  return domain;
Loading