From fe6d79586a9abbd1d764bbfc36bed84c7b802601 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 15 Mar 2015 01:19:58 -0500 Subject: [PATCH] Adjust error messages in the Histogram class. --- include/deal.II/numerics/histogram.h | 12 +++--------- source/numerics/histogram.cc | 10 +++++++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/include/deal.II/numerics/histogram.h b/include/deal.II/numerics/histogram.h index 787555d139..889d6253d2 100644 --- a/include/deal.II/numerics/histogram.h +++ b/include/deal.II/numerics/histogram.h @@ -145,15 +145,9 @@ public: /** * Exception. */ - DeclException0 (ExcEmptyData); - /** - * Exception. - */ - DeclException0 (ExcInvalidIntervals); - /** - * Exception. - */ - DeclException0 (ExcInvalidData); + DeclExceptionMsg (ExcEmptyData, + "Your input argument to this function does not appear to " + "have any data in it."); /** * Exception. */ diff --git a/source/numerics/histogram.cc b/source/numerics/histogram.cc index 1b44f221f6..4811b3529f 100644 --- a/source/numerics/histogram.cc +++ b/source/numerics/histogram.cc @@ -56,8 +56,10 @@ void Histogram::evaluate (const std::vector > &values, const unsigned int n_intervals, const IntervalSpacing interval_spacing) { - Assert (values.size() > 0, ExcEmptyData()); - Assert (n_intervals > 0, ExcInvalidIntervals()); + Assert (values.size() > 0, + ExcMessage("Your input data needs to contain at least one input vector.")); + Assert (n_intervals > 0, + ExcMessage("The number of intervals needs to be at least one.")); for (unsigned int i=0; i 0, ExcEmptyData()); Assert (values.size() == y_values_.size(), @@ -216,7 +218,9 @@ void Histogram::evaluate (const Vector &values, void Histogram::write_gnuplot (std::ostream &out) const { AssertThrow (out, ExcIO()); - Assert (!intervals.empty(), ExcEmptyData()); + Assert (!intervals.empty(), + ExcMessage("There is nothing to write into the output file. " + "Did you forget to call the evaluate() function?")); // do a simple 2d plot, if only // one data set is available -- 2.39.5