}
else if (ex instanceof GeneralException)
{
// Remove any nested exceptions (particularly want to insure no PersistenceExceptions get sent - they
// are not serializable plus contain details that should not be exposed to users)
return (ex.getCause() == null) ? ex : new GeneralException(ex.getMessage());
}
else if (ex instanceof ExecutionException)
{
// Remove any nested exceptions
return (ex.getCause() == null) ? ex : new ExecutionException(ex.getMessage());
}
else if (ex instanceof InvalidActionException)
{
return new GeneralException("Invalid action.");
}
else if (ex instanceof NoSuchBeanDefinitionException)
{
return new GeneralException("Invalid action.");
}
else if (ex instanceof SessionException)
{
return new SessionException();
}
else
{
return new GeneralException("Error performing action.");
}
}