Class InvalidOperationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.atlassian.sal.api.i18n.InvalidOperationException
All Implemented Interfaces:
Serializable

@PublicApi public class InvalidOperationException extends Exception
Thrown if the application decides that the attempted operation is not allowed for some reason.

This Exception should normally be used for "expected" errors where it is meaningful to display the error message to the end user.

Host applications throwing this Exception are expected to localise the message into the locale of the currently logged in user. Consumers catching this Exception are encouraged to use getLocalizedMessage() in order to get the translated error message.

Since:
3.0
See Also:
  • Constructor Details

    • InvalidOperationException

      @Internal public InvalidOperationException(String message, String localizedMessage)
  • Method Details

    • getLocalizedMessage

      public String getLocalizedMessage()
      Returns the error message in the locale of the currently logged in user.

      If no user is logged in, this should use the default locale for the host application.

      Overrides:
      getLocalizedMessage in class Throwable
      Returns:
      the error message in the locale of the currently logged in user.
      See Also: