Fix to catch PlatformRuntimeException (from SpringSurf) and throw out expected exception where appropriate.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18612 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2010-02-12 12:54:21 +00:00
parent 9ff57c2227
commit 3596c4e344

View File

@@ -586,9 +586,16 @@ public class DefaultTypeConverter
INSTANCE.addConverter(Date.class, String.class, new TypeConverter.Converter<Date, String>() INSTANCE.addConverter(Date.class, String.class, new TypeConverter.Converter<Date, String>()
{ {
public String convert(Date source) public String convert(Date source)
{
try
{ {
return ISO8601DateFormat.format(source); return ISO8601DateFormat.format(source);
} }
catch (PlatformRuntimeException e)
{
throw new TypeConversionException("Failed to convert date " + source + " to string", e);
}
}
}); });
INSTANCE.addConverter(Date.class, Calendar.class, new TypeConverter.Converter<Date, Calendar>() INSTANCE.addConverter(Date.class, Calendar.class, new TypeConverter.Converter<Date, Calendar>()
@@ -769,9 +776,16 @@ public class DefaultTypeConverter
INSTANCE.addConverter(Calendar.class, String.class, new TypeConverter.Converter<Calendar, String>() INSTANCE.addConverter(Calendar.class, String.class, new TypeConverter.Converter<Calendar, String>()
{ {
public String convert(Calendar source) public String convert(Calendar source)
{
try
{ {
return ISO8601DateFormat.format(source.getTime()); return ISO8601DateFormat.format(source.getTime());
} }
catch (PlatformRuntimeException e)
{
throw new TypeConversionException("Failed to convert date " + source + " to string", e);
}
}
}); });
// //