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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user