Pass the property key along via the exception.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2973 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2010-12-19 19:26:11 +00:00
parent 4871bc817f
commit 939f501ae4
2 changed files with 10 additions and 2 deletions
@@ -27,8 +27,16 @@ package com.samskivert.util;
*/
public class MissingPropertyException extends RuntimeException
{
public MissingPropertyException (String message)
public MissingPropertyException (String key, String message)
{
super(message);
_key = key;
}
public String getKey ()
{
return _key;
}
protected String _key;
}
@@ -238,7 +238,7 @@ public class PropertiesUtil
{
String value = props.getProperty(key);
if (StringUtil.isBlank(value)) {
throw new MissingPropertyException(missingMessage);
throw new MissingPropertyException(key, missingMessage);
}
return value;
}