catch possible exception and convert to JDO type