mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -586,9 +586,16 @@ public class DefaultTypeConverter
|
||||
INSTANCE.addConverter(Date.class, String.class, new TypeConverter.Converter<Date, String>()
|
||||
{
|
||||
public String convert(Date source)
|
||||
{
|
||||
try
|
||||
{
|
||||
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>()
|
||||
@@ -769,9 +776,16 @@ public class DefaultTypeConverter
|
||||
INSTANCE.addConverter(Calendar.class, String.class, new TypeConverter.Converter<Calendar, String>()
|
||||
{
|
||||
public String convert(Calendar source)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ISO8601DateFormat.format(source.getTime());
|
||||
}
|
||||
catch (PlatformRuntimeException e)
|
||||
{
|
||||
throw new TypeConversionException("Failed to convert date " + source + " to string", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user