From b52b2ce9fc1f8bc3b32bf730a97870624aba011c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 26 Jul 2014 07:58:55 -0500 Subject: [PATCH] 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. --- source/base/parsed_function.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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).")); } } -- 2.39.5