From 468d493aefc34963f61f9d5362b8526f76fbdcce Mon Sep 17 00:00:00 2001 From: idfx Date: Thu, 9 May 2002 14:23:09 +0000 Subject: [PATCH] another small exception-change --- source/mir/util/ParameterExpander.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/source/mir/util/ParameterExpander.java b/source/mir/util/ParameterExpander.java index bb677d75..63a27331 100755 --- a/source/mir/util/ParameterExpander.java +++ b/source/mir/util/ParameterExpander.java @@ -1,5 +1,8 @@ package mir.util; +import multex.Failure; +import multex.Exc; + import java.util.*; public class ParameterExpander { @@ -49,7 +52,7 @@ public class ParameterExpander { location = location + part; if (node == null) { - throw new Exception( "Can't expand key " + aKey + ": "+ location + " does not exist" ); + throw new ParameterExpanderExc( "Can't expand key {1}: {2} does not exist", new Object[]{aKey,location} ); } } @@ -58,7 +61,7 @@ public class ParameterExpander { } if (!(node instanceof String)) - throw new Exception( "Can't expand key " + aKey + ": "+ location + " is not a string but a " + node.getClass().getName() ); + throw new ParameterExpanderExc( "Can't expand key {1}: {2} is not a string but a {3}", new Object[]{aKey,location,node.getClass().getName()} ); return (String) node; } @@ -85,7 +88,7 @@ public class ParameterExpander { previousPosition=endOfNamePosition+1; } else { - throw new Exception("Missing } in " + anExpression); + throw new ParameterExpanderExc("Missing } in {1}",new Object[]{anExpression}); } } else @@ -99,6 +102,12 @@ public class ParameterExpander { return result.toString(); } + + public static class ParameterExpanderExc extends Exc { + public ParameterExpanderExc(String msg, Object[] objects) { + super(msg, objects); + } + } } -- 2.11.0