Class NucleusException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.datanucleus.exceptions.NucleusException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ClassNotResolvedException, CommitStateTransitionException, IllegalStateTransitionException, NoQueryResultsException, NotYetFlushedException, NucleusCanRetryException, NucleusDataStoreException, NucleusEnhanceException, NucleusObjectNotFoundException, NucleusOptimisticException, NucleusTransactionException, NucleusUserException, PrimaryExpressionIsClassLiteralException, PrimaryExpressionIsClassStaticFieldException, PrimaryExpressionIsInvokeException, PrimaryExpressionIsVariableException, QueryInterruptedException, QueryTimeoutException, RollbackStateTransitionException, ValueGenerationException
Base exception thrown by DataNucleus.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) ObjectThe object being processed when the error was encountered (optional).(package private) booleanFlag defining if this exception is fatal, or could be retried with the possibility of success.(package private) Throwable[]Array of nested Throwables (optional)private static final long -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new exception without a detail message.NucleusException(String msg) Constructs a new exception with the specified detail message.NucleusException(String msg, Object failed) Constructs a new exception with the specified detail message and failed object.NucleusException(String msg, Throwable nested) Constructs a new exception with the specified detail message and nestedThrowable.NucleusException(String msg, Throwable[] nested) Constructs a new exception with the specified detail message and nestedThrowables.NucleusException(String msg, Throwable[] nested, Object failed) Constructs a new exception with the specified detail message, nestedThrowables, and failed object.NucleusException(String msg, Throwable nested, Object failed) Constructs a new exception with the specified detail message, nestedThrowable, and failed object. -
Method Summary
Modifier and TypeMethodDescriptiongetCause()Return the first nested exception (if any), otherwise null.The exception may include a failed object.The exception may have been caused by multiple exceptions in the runtime.booleanisFatal()Accessor for whether the exception is fatal, or retriable.voidPrints thisExceptionand its backtrace to the standard error output.voidPrints thisExceptionand its backtrace to the specified print stream.voidPrints thisExceptionand its backtrace to the specified print writer.setFatal()Method to set the exception as being fatal.voidsetNestedException(Throwable nested) Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
nested
Throwable[] nestedArray of nested Throwables (optional) -
failed
Object failedThe object being processed when the error was encountered (optional). -
fatal
boolean fatalFlag defining if this exception is fatal, or could be retried with the possibility of success.
-
-
Constructor Details
-
NucleusException
public NucleusException()Constructs a new exception without a detail message. -
NucleusException
Constructs a new exception with the specified detail message.- Parameters:
msg- the detail message.
-
NucleusException
-
NucleusException
-
NucleusException
-
NucleusException
-
NucleusException
-
-
Method Details
-
setFatal
Method to set the exception as being fatal. Returns the exception so that user code can call "throw new NucleusException(...).setFatal();"- Returns:
- This exception (for convenience)
-
isFatal
public boolean isFatal()Accessor for whether the exception is fatal, or retriable.- Returns:
- Whether it is fatal
-
getFailedObject
The exception may include a failed object.- Returns:
- the failed object.
-
setNestedException
-
getNestedExceptions
The exception may have been caused by multiple exceptions in the runtime. If multiple objects caused the problem, each failed object will have its ownException.- Returns:
- the nested Throwable array.
-
getCause
-
printStackTrace
public void printStackTrace()Prints thisExceptionand its backtrace to the standard error output. Print nested Throwables' stack trace as well.- Overrides:
printStackTracein classThrowable
-
printStackTrace
Prints thisExceptionand its backtrace to the specified print stream. Print nested Throwables' stack trace as well.- Overrides:
printStackTracein classThrowable- Parameters:
s-PrintStreamto use for output
-
printStackTrace
Prints thisExceptionand its backtrace to the specified print writer. Print nested Throwables' stack trace as well.- Overrides:
printStackTracein classThrowable- Parameters:
s-PrintWriterto use for output
-