From: Wolfgang Bangerth Date: Sat, 26 Jul 2014 12:58:55 +0000 (-0500) Subject: Improve the wording of an exception. X-Git-Tag: v8.2.0-rc1~243^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F33%2Fhead;p=dealii.git Improve the wording of an exception. I ran into this exception and couldn't figure out what's wrong without looking at the source code. --- diff --git a/source/base/parsed_function.cc b/source/base/parsed_function.cc index 14b975a039..47dea746d3 100644 --- a/source/base/parsed_function.cc +++ b/source/base/parsed_function.cc @@ -128,7 +128,7 @@ namespace Functions constants["pi"] = numbers::PI; constants["Pi"] = numbers::PI; - unsigned int nn = (Utilities::split_string_list(vnames)).size(); + const unsigned int nn = (Utilities::split_string_list(vnames)).size(); switch (nn) { case dim: @@ -140,7 +140,13 @@ namespace Functions function_object.initialize(vnames, expression, constants, true); break; default: - AssertThrow(false, ExcMessage("Not the correct size. Check your code.")); + AssertThrow(false, + ExcMessage("The list of variables specified is <" + vnames + + "> which is a list of length " + + Utilities::int_to_string(nn) + + " but it has to be a list of length equal to" + + " either dim (for a time-independent function)" + + " or dim+1 (for a time-dependent function).")); } }