Class NucleusException

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.Object failed
      The object being processed when the error was encountered (optional).
      (package private) boolean fatal
      Flag defining if this exception is fatal, or could be retried with the possibility of success.
      (package private) java.lang.Throwable[] nested
      Array of nested Throwables (optional)
      private static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      NucleusException()
      Constructs a new exception without a detail message.
      NucleusException​(java.lang.String msg)
      Constructs a new exception with the specified detail message.
      NucleusException​(java.lang.String msg, java.lang.Object failed)
      Constructs a new exception with the specified detail message and failed object.
      NucleusException​(java.lang.String msg, java.lang.Throwable nested)
      Constructs a new exception with the specified detail message and nested Throwable.
      NucleusException​(java.lang.String msg, java.lang.Throwable[] nested)
      Constructs a new exception with the specified detail message and nested Throwables.
      NucleusException​(java.lang.String msg, java.lang.Throwable[] nested, java.lang.Object failed)
      Constructs a new exception with the specified detail message, nested Throwables, and failed object.
      NucleusException​(java.lang.String msg, java.lang.Throwable nested, java.lang.Object failed)
      Constructs a new exception with the specified detail message, nested Throwable, and failed object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Throwable getCause()
      Return the first nested exception (if any), otherwise null.
      java.lang.Object getFailedObject()
      The exception may include a failed object.
      java.lang.Throwable[] getNestedExceptions()
      The exception may have been caused by multiple exceptions in the runtime.
      boolean isFatal()
      Accessor for whether the exception is fatal, or retriable.
      void printStackTrace()
      Prints this Exception and its backtrace to the standard error output.
      void printStackTrace​(java.io.PrintStream s)
      Prints this Exception and its backtrace to the specified print stream.
      void printStackTrace​(java.io.PrintWriter s)
      Prints this Exception and its backtrace to the specified print writer.
      NucleusException setFatal()
      Method to set the exception as being fatal.
      void setNestedException​(java.lang.Throwable nested)  
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • nested

        java.lang.Throwable[] nested
        Array of nested Throwables (optional)
      • failed

        java.lang.Object failed
        The object being processed when the error was encountered (optional).
      • fatal

        boolean fatal
        Flag defining if this exception is fatal, or could be retried with the possibility of success.
    • Constructor Detail

      • NucleusException

        public NucleusException()
        Constructs a new exception without a detail message.
      • NucleusException

        public NucleusException​(java.lang.String msg)
        Constructs a new exception with the specified detail message.
        Parameters:
        msg - the detail message.
      • NucleusException

        public NucleusException​(java.lang.String msg,
                                java.lang.Throwable[] nested)
        Constructs a new exception with the specified detail message and nested Throwables.
        Parameters:
        msg - the detail message.
        nested - the nested Throwable[].
      • NucleusException

        public NucleusException​(java.lang.String msg,
                                java.lang.Throwable nested)
        Constructs a new exception with the specified detail message and nested Throwable.
        Parameters:
        msg - the detail message.
        nested - the nested Throwable.
      • NucleusException

        public NucleusException​(java.lang.String msg,
                                java.lang.Object failed)
        Constructs a new exception with the specified detail message and failed object.
        Parameters:
        msg - the detail message.
        failed - the failed object.
      • NucleusException

        public NucleusException​(java.lang.String msg,
                                java.lang.Throwable[] nested,
                                java.lang.Object failed)
        Constructs a new exception with the specified detail message, nested Throwables, and failed object.
        Parameters:
        msg - the detail message.
        nested - the nested Throwable[].
        failed - the failed object.
      • NucleusException

        public NucleusException​(java.lang.String msg,
                                java.lang.Throwable nested,
                                java.lang.Object failed)
        Constructs a new exception with the specified detail message, nested Throwable, and failed object.
        Parameters:
        msg - the detail message.
        nested - the nested Throwable.
        failed - the failed object.
    • Method Detail

      • setFatal

        public NucleusException 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

        public java.lang.Object getFailedObject()
        The exception may include a failed object.
        Returns:
        the failed object.
      • setNestedException

        public void setNestedException​(java.lang.Throwable nested)
      • getNestedExceptions

        public java.lang.Throwable[] 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 own Exception.
        Returns:
        the nested Throwable array.
      • getCause

        public java.lang.Throwable getCause()
        Return the first nested exception (if any), otherwise null.
        Overrides:
        getCause in class java.lang.Throwable
        Returns:
        the first or only nested Throwable.
      • printStackTrace

        public void printStackTrace()
        Prints this Exception and its backtrace to the standard error output. Print nested Throwables' stack trace as well.
        Overrides:
        printStackTrace in class java.lang.Throwable
      • printStackTrace

        public void printStackTrace​(java.io.PrintStream s)
        Prints this Exception and its backtrace to the specified print stream. Print nested Throwables' stack trace as well.
        Overrides:
        printStackTrace in class java.lang.Throwable
        Parameters:
        s - PrintStream to use for output
      • printStackTrace

        public void printStackTrace​(java.io.PrintWriter s)
        Prints this Exception and its backtrace to the specified print writer. Print nested Throwables' stack trace as well.
        Overrides:
        printStackTrace in class java.lang.Throwable
        Parameters:
        s - PrintWriter to use for output