/** * Translate the exception with the failed object. * * @param re exception raised by the delegate. * @param failed the context that failed. * * @return the translated exception. If the given input exception had not set * the failed instance, then sets the given instance as the failed context. */ protected RuntimeException translate(RuntimeException re, Object failed) { if (re instanceof OpenJPAException) { Object o = ((OpenJPAException) re).getFailedObject(); if (o == null || "null".equals(o)) { ((OpenJPAException) re).setFailedObject(Exceptions.toString(failed)); } } return (_trans == null) ? re : _trans.translate(re); }
/** * Translate the exception with the failed object. * * @param re exception raised by the delegate. * @param failed the context that failed. * * @return the translated exception. If the given input exception had not set * the failed instance, then sets the given instance as the failed context. */ protected RuntimeException translate(RuntimeException re, Object failed) { if (re instanceof OpenJPAException) { Object o = ((OpenJPAException) re).getFailedObject(); if (o == null || "null".equals(o)) { ((OpenJPAException) re).setFailedObject(Exceptions.toString(failed)); } } return (_trans == null) ? re : _trans.translate(re); }
/** * Translate the exception with the failed object. * * @param re exception raised by the delegate. * @param failed the context that failed. * * @return the translated exception. If the given input exception had not set * the failed instance, then sets the given instance as the failed context. */ protected RuntimeException translate(RuntimeException re, Object failed) { if (re instanceof OpenJPAException) { Object o = ((OpenJPAException) re).getFailedObject(); if (o == null || "null".equals(o)) { ((OpenJPAException) re).setFailedObject(Exceptions.toString(failed)); } } return (_trans == null) ? re : _trans.translate(re); }
/** * Translate the exception with the failed object. * * @param re exception raised by the delegate. * @param failed the context that failed. * * @return the translated exception. If the given input exception had not set * the failed instance, then sets the given instance as the failed context. */ protected RuntimeException translate(RuntimeException re, Object failed) { if (re instanceof OpenJPAException) { Object o = ((OpenJPAException) re).getFailedObject(); if (o == null || "null".equals(o)) { ((OpenJPAException) re).setFailedObject(Exceptions.toString(failed)); } } return (_trans == null) ? re : _trans.translate(re); }
throw new UserException(_loc.get("bad-externalized-value", new Object[] { val, extValues.keySet(), this })) .setFatal(true).setFailedObject(val); } else { return foundVal;
throw new UserException(_loc.get("bad-externalized-value", new Object[] { val, extValues.keySet(), this })) .setFatal(true).setFailedObject(val); } else { return foundVal;
throw new UserException(_loc.get("bad-externalized-value", new Object[] { val, extValues.keySet(), this })) .setFatal(true).setFailedObject(val); } else { return foundVal;
setNestedThrowables(t).setFatal(true).setFailedObject(failedObject);
setNestedThrowables(t).setFatal(true).setFailedObject(failedObject);
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = narrow(msg, causes[0], failed); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = narrow(msg, causes[0], failed); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
setNestedThrowables(t).setFatal(true).setFailedObject(failedObject);
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = SQLExceptions.narrow(msg, causes[0], this); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
setNestedThrowables(t).setFatal(true).setFailedObject(failedObject);
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = narrow(msg, causes[0], failed); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
/** * Return a new exception that wraps <code>causes</code>. * However, the details of exactly what type of exception is returned can * be determined by the implementation. This may take into account * DB-specific exception information in <code>causes</code>. */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { OpenJPAException ret = narrow(msg, causes[0], failed); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); }
} catch (OpenJPAException e) { if (e.getFailedObject() == null) { e.setFailedObject(getQueryString());
} catch (OpenJPAException e) { if (e.getFailedObject() == null) { e.setFailedObject(getQueryString());
} catch (OpenJPAException e) { if (e.getFailedObject() == null) { e.setFailedObject(getQueryString());
} catch (OpenJPAException e) { if (e.getFailedObject() == null) { e.setFailedObject(getQueryString());