From 5a1d86bc327d1d8b470b5b68ca12a041af7b33f2 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 6 Sep 2016 08:57:35 -0400 Subject: [PATCH] Exception message improvements - keep quotes in the output - fix formatting/grammar for a couple of exceptions --- doc/doxygen/custom.js | 1 + include/deal.II/algorithms/any_data.h | 4 ++-- include/deal.II/base/data_out_base.h | 2 +- include/deal.II/base/exceptions.h | 16 ++++++++-------- include/deal.II/base/function_cspline.h | 2 +- include/deal.II/base/parameter_handler.h | 6 +++--- include/deal.II/base/partitioner.h | 2 +- include/deal.II/base/path_search.h | 7 +++---- include/deal.II/base/table_handler.h | 4 ++-- include/deal.II/fe/fe_values.h | 13 ++++++------- include/deal.II/grid/grid_tools.h | 6 +++--- 11 files changed, 31 insertions(+), 32 deletions(-) diff --git a/doc/doxygen/custom.js b/doc/doxygen/custom.js index ed5f067aa6..508f330e10 100644 --- a/doc/doxygen/custom.js +++ b/doc/doxygen/custom.js @@ -3,6 +3,7 @@ $( document ).ready( function() { $('.doxygen-generated-exception-message').each(function(i, obj) { var s = $(this).html(); s=s.replace(/\\n|std::endl/g,"
"); + s=s.replace(/\\"/g,"'"); s=s.replace(/"|<</g,""); s=s.replace(/arg1/g,"arg1"); s=s.replace(/arg2/g,"arg2"); diff --git a/include/deal.II/algorithms/any_data.h b/include/deal.II/algorithms/any_data.h index 33bd563221..93ca7b2eda 100644 --- a/include/deal.II/algorithms/any_data.h +++ b/include/deal.II/algorithms/any_data.h @@ -178,14 +178,14 @@ public: char *, char *, << "The requested type " << arg1 << " and the stored type " << arg2 - << " must coincide"); + << " must coincide."); /** * Exception indicating that a function expected a vector to have a certain * name, but we store a different name in that position. */ DeclException2(ExcNameMismatch, int, std::string, - << "Name at position " << arg1 << " is not equal to " << arg2); + << "Name at position " << arg1 << " is not equal to " << arg2 << "."); private: /// The stored data std::vector data; diff --git a/include/deal.II/base/data_out_base.h b/include/deal.II/base/data_out_base.h index 78eb6e6619..3bef6b5c76 100644 --- a/include/deal.II/base/data_out_base.h +++ b/include/deal.II/base/data_out_base.h @@ -1872,7 +1872,7 @@ namespace DataOutBase DeclException1 (ExcErrorOpeningTecplotFile, char *, << "There was an error opening Tecplot file " << arg1 - << " for output"); + << " for output."); //@} } diff --git a/include/deal.II/base/exceptions.h b/include/deal.II/base/exceptions.h index 63b338f265..80ffb6fd4e 100644 --- a/include/deal.II/base/exceptions.h +++ b/include/deal.II/base/exceptions.h @@ -639,7 +639,7 @@ namespace StandardExceptions << "value is a finite number (as opposed to plus or minus infinity, or " << "NaN/Not a Number). In the current function, we encountered a number " << "that is not finite (its value is " << arg1 << " and therefore " - << "violates the current assertion.\n\n" + << "violates the current assertion).\n\n" << "This may be due to the fact that some operation in this function " << "created such a value, or because one of the arguments you passed " << "to the function already had this value from some previous " @@ -682,7 +682,7 @@ namespace StandardExceptions */ DeclException1 (ExcMemoryLeak, int, << "Destroying memory handler while " << arg1 - << " objects are still allocated"); + << " objects are still allocated."); /** * An error occurred reading or writing a file. @@ -718,7 +718,7 @@ namespace StandardExceptions */ DeclException1 (ExcFileNotOpen, char *, - << "Could not open file " << arg1); + << "Could not open file " << arg1 << "."); /** * Exception denoting a part of the library or application program that has @@ -883,7 +883,7 @@ namespace StandardExceptions */ DeclException2 (ExcDimensionMismatch, std::size_t, std::size_t, - << "Dimension " << arg1 << " not equal to " << arg2); + << "Dimension " << arg1 << " not equal to " << arg2 << "."); /** * The first dimension should be either equal to the second or the third, @@ -892,7 +892,7 @@ namespace StandardExceptions DeclException3 (ExcDimensionMismatch2, int, int, int, << "Dimension " << arg1 << " neither equal to " << arg2 - << " nor to " << arg3); + << " nor to " << arg3 << "."); /** * This exception indicates that an index is not within the expected range. @@ -923,7 +923,7 @@ namespace StandardExceptions * For example, it may be that you are trying to access an element of a * vector which does not exist. * - * The constructor takes three int arguments, namely + * The constructor takes three arguments, namely *
    *
  1. the violating index *
  2. the lower bound @@ -952,7 +952,7 @@ namespace StandardExceptions DeclException2 (ExcLowerRange, int, int, << "Number " << arg1 << " must be larger than or equal " - << arg2 << ")."); + << arg2 << "."); /** * A generic exception definition for the ExcLowerRange above. @@ -970,7 +970,7 @@ namespace StandardExceptions DeclException2 (ExcNotMultiple, int, int, << "Division " << arg1 << " by " << arg2 - << " has remainder different from zero"); + << " has remainder different from zero."); /** * This exception is thrown if the iterator you access has corrupted data. diff --git a/include/deal.II/base/function_cspline.h b/include/deal.II/base/function_cspline.h index cf5577014d..0d324460dc 100644 --- a/include/deal.II/base/function_cspline.h +++ b/include/deal.II/base/function_cspline.h @@ -43,7 +43,7 @@ namespace Functions int, double, double, - << "The input interpolation points are not strictly ordered : " << std::endl << "x[" << arg1 << "] = "<< arg2 <<" >= x["<<(arg1+1)<<" = "<= x["<<(arg1+1)<<"] = "< does not match the given pattern <" << arg2 << ">"); + << "> does not match the given pattern <" << arg2 << ">."); /** * Exception */ @@ -1958,7 +1958,7 @@ public: */ DeclException1 (ExcEntryUndeclared, std::string, - << "You can't ask for entry <" << arg1 << "> you have not yet declared"); + << "You can't ask for entry <" << arg1 << "> you have not yet declared."); //@} private: /** diff --git a/include/deal.II/base/partitioner.h b/include/deal.II/base/partitioner.h index b3de62cfb7..24274ea7dc 100644 --- a/include/deal.II/base/partitioner.h +++ b/include/deal.II/base/partitioner.h @@ -288,7 +288,7 @@ namespace Utilities types::global_dof_index, unsigned int, << "Global index " << arg1 - << " neither owned nor ghost on proc " << arg2); + << " neither owned nor ghost on proc " << arg2 << "."); private: /** diff --git a/include/deal.II/base/path_search.h b/include/deal.II/base/path_search.h index 94ec30f925..ad75608f44 100644 --- a/include/deal.II/base/path_search.h +++ b/include/deal.II/base/path_search.h @@ -177,7 +177,7 @@ public: std::string, << "The class " << arg1 - << " must be registered before referring it in PathSearch"); + << " must be registered before referring it in PathSearch."); /** * The PathSearch class could not find a file with this name in its path * list. @@ -185,9 +185,8 @@ public: */ DeclException2(ExcFileNotFound, std::string, std::string, - << "The file \"" << arg1 - << "\" was not found in the path for files of class " - << arg2); + << "The file \"" << arg1 << "\" was not found in the path for " + << "files of class " << arg2 << "."); private: /** diff --git a/include/deal.II/base/table_handler.h b/include/deal.II/base/table_handler.h index c7dc0eab92..1b0b711ef1 100644 --- a/include/deal.II/base/table_handler.h +++ b/include/deal.II/base/table_handler.h @@ -505,8 +505,8 @@ public: */ DeclException4 (ExcWrongNumberOfDataEntries, std::string, int, std::string, int, - << "Column <" << arg1 << "> has got " << arg2 - << " rows, but Column <" << arg3 << "> has got " << arg4 << "."); + << "Column <" << arg1 << "> has " << arg2 + << " rows, but Column <" << arg3 << "> has " << arg4 << " rows."); /** * Exception diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index c20ce9a6e0..adc0af782a 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -2539,13 +2539,12 @@ public: */ DeclException1 (ExcAccessToUninitializedField, char *, - << ("You are requesting information from an FEValues/FEFaceValues/FESubfaceValues " - "object for which this kind of information has not been computed. What " - "information these objects compute is determined by the update_* flags you " - "pass to the constructor. Here, the operation you are attempting requires " - "the <") - << arg1 - << "> flag to be set, but it was apparently not specified upon construction."); + << "You are requesting information from an FEValues/FEFaceValues/FESubfaceValues " + << "object for which this kind of information has not been computed. What " + << "information these objects compute is determined by the update_* flags you " + << "pass to the constructor. Here, the operation you are attempting requires " + << "the <" << arg1 << "> flag to be set, but it was apparently not specified " + << "upon construction."); /** * @todo Document this * diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index 17e1327b64..a4a34ba646 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -1579,7 +1579,7 @@ namespace GridTools */ DeclException1 (ExcScalingFactorNotPositive, double, - << "The scaling factor must be positive, but is " << arg1); + << "The scaling factor must be positive, but it is " << arg1 << "."); /** * Exception */ @@ -1604,8 +1604,8 @@ namespace GridTools */ DeclException1 (ExcVertexNotUsed, unsigned int, - << "The given vertex " << arg1 - << " is not used in the given triangulation"); + << "The given vertex with index " << arg1 + << " is not used in the given triangulation."); /*@}*/ -- 2.39.5