if (jpe.isFatal())
{
//sadly JDOFatalDataStoreException dont allow nested exceptions and failed objects together
if (jpe.getFailedObject() != null)
{
return new JDOFatalDataStoreException(jpe.getMessage(), jpe.getFailedObject());
}
else if (jpe.getNestedExceptions() != null)
{
return new JDOFatalDataStoreException(jpe.getMessage(), jpe.getNestedExceptions());
}
else
{
return new JDOFatalDataStoreException(jpe.getMessage(), jpe);
}
}
else
{
if (jpe.getNestedExceptions() != null)
{
if (jpe.getFailedObject() != null)
{
return new JDODataStoreException(jpe.getMessage(), jpe.getNestedExceptions(), jpe.getFailedObject());
}
return new JDODataStoreException(jpe.getMessage(), jpe.getNestedExceptions());
}
else if (jpe.getFailedObject() != null)
{
return new JDODataStoreException(jpe.getMessage(), jpe.getFailedObject());
}
else
{
return new JDODataStoreException(jpe.getMessage(), jpe);
}
}
}
else if (jpe instanceof JPOXObjectNotFoundException)
{
//sadly JDOObjectNotFoundException dont allow nested exceptions and failed objects together
if (jpe.getFailedObject() != null)
{
return new JDOObjectNotFoundException(jpe.getMessage(), jpe.getFailedObject());
}
else if (jpe.getNestedExceptions() != null)
{
return new JDOObjectNotFoundException(jpe.getMessage(), jpe.getNestedExceptions());
}
else
{
return new JDOFatalDataStoreException(jpe.getMessage(), jpe);
}
}
else if (jpe instanceof JPOXUserException)
{
if (jpe.isFatal())