Class UiExceptionThrower

java.lang.Object
com.saperion.ngc.util.UiExceptionThrower

public class UiExceptionThrower extends Object
Utility class for UI-Exception handling.
  • Constructor Details

    • UiExceptionThrower

      public UiExceptionThrower(Class<?> clazz, String methodName)
      Constructor.
      Parameters:
      clazz - the class
      methodName - the method name
  • Method Details

    • throwIt

      public void throwIt(Exception e, String localizationKey) throws NgcUiException
      Throw an NgcUiException containing both a log-message and an error-message for the user.
      Parameters:
      e - causing exception
      localizationKey - localization key for user error-message
      Throws:
      NgcUiException - exception to be handled by view
    • throwIt

      public void throwIt(Exception e, String localizationKey, Map<String,String> replacements) throws NgcUiException
      Throw an NgcUiException containing both a log-message and an error-message for the user.
      Parameters:
      e - causing exception
      localizationKey - localization key for user error-message
      replacements - string replacements for user error message
      Throws:
      NgcUiException - exception to be handled by view
    • throwIt

      public void throwIt(String message, String localizationKey) throws NgcUiException
      Throw an NgcUiException containing both a log-message and an error-message for the user.
      Parameters:
      message - log-message
      localizationKey - localization key for user error-message
      Throws:
      NgcUiException - exception to be handled by view
    • throwIt

      public void throwIt(String localizationKey) throws NgcUiException
      Throw an NgcUiException containing both an error-message for the user only.
      Parameters:
      localizationKey - localization key for user error-message
      Throws:
      NgcUiException - exception to be handled by view
    • throwIt

      public void throwIt(Exception e) throws NgcUiException
      Throw an NgcUiException containing a log-message only.
      Parameters:
      e - causing exception
      Throws:
      NgcUiException - exception to be handled by view
    • throwIt

      public void throwIt(String message, String localizationKey, Map<String,String> replacements) throws NgcUiException
      Throws a NgcUiException containing the error message and the user message with replacements.
      Parameters:
      message - error message
      localizationKey - localization key for user message
      replacements - replacements for user message
      Throws:
      NgcUiException - exception to be handled by view