Class IpsException

  • All Implemented Interfaces:
    java.io.Serializable

    public class IpsException
    extends java.lang.RuntimeException
    The IpsException is intended to replace Eclipse's CoreException. Checked Exceptions should be removed from method signatures.

    During the migration phase, to avoid CoreExceptions in client code, catch all CoreExceptions thrown by framework/FIPS-Devtools code, create a IpsException and throw it instead. Use the IpsException(CoreException) constructor.

    As the IpsException is an (unchecked) RuntimeException it is not declared by method signatures explicitly, which is exactly what we want to achieve. If one of your methods throws a IpsException, document that it does and in which cases this happens.

    Since:
    22.6, replacing org.faktorips.devtools.model.exception.CoreRuntimeException
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      IpsException​(java.lang.String message)
      Constructor that should be used when replacing the creation of CoreExceptions.
      IpsException​(java.lang.String message, java.lang.Throwable cause)  
      IpsException​(java.lang.String message, org.eclipse.core.runtime.CoreException cause)  
      IpsException​(java.lang.String message, IpsException cause)  
      IpsException​(org.eclipse.core.runtime.CoreException cause)
      Constructor that should be used when a CoreException needs to be wrapped into an unchecked exception.
      IpsException​(org.eclipse.core.runtime.IStatus status)
      Constructor that wraps a status in a IpsException by creating a new CoreException internally.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.eclipse.core.runtime.IStatus getStatus()  
      • Methods inherited from class java.lang.Throwable

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

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

      • IpsException

        public IpsException​(org.eclipse.core.runtime.CoreException cause)
        Constructor that should be used when a CoreException needs to be wrapped into an unchecked exception.
      • IpsException

        public IpsException​(org.eclipse.core.runtime.IStatus status)
        Constructor that wraps a status in a IpsException by creating a new CoreException internally.
      • IpsException

        public IpsException​(java.lang.String message,
                            org.eclipse.core.runtime.CoreException cause)
      • IpsException

        public IpsException​(java.lang.String message,
                            java.lang.Throwable cause)
      • IpsException

        public IpsException​(java.lang.String message)
        Constructor that should be used when replacing the creation of CoreExceptions. Instead of the CoreException create an IpsException with the same error message.

        For example this constructor could be used when operations on the model cannot continue due to inconsistencies. E.g. when a component or type not found by qualified name and find() returned null.

      • IpsException

        public IpsException​(java.lang.String message,
                            IpsException cause)
    • Method Detail

      • getStatus

        public org.eclipse.core.runtime.IStatus getStatus()