Interface ExceptionMessage

  • All Superinterfaces:
    org.pf4j.ExtensionPoint, com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint

    public interface ExceptionMessage
    extends com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint
    An extension point to create exception messages, typically for end-users. Note that the original message on the exception can not be modified as it is immutable - the message generated here will always be appended to the original message.

    This can be used to provide more failure-scenario context to end-users.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.String> message​(java.lang.String errorCode, ExceptionDetails exceptionDetails)
      Create the message.
      java.util.Optional<java.lang.String> message​(java.lang.Throwable throwable, ExceptionDetails exceptionDetails)
      Create the message.
      • Methods inherited from interface com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint

        getExtensionClass, getPluginId
    • Method Detail

      • message

        java.util.Optional<java.lang.String> message​(java.lang.Throwable throwable,
                                                     @Nullable
                                                     ExceptionDetails exceptionDetails)
        Create the message. If markdown is included, it will be rendered correctly in the UI.
        Parameters:
        throwable - The thrown exception. Used to help provide context when creating the message.
        exceptionDetails - Additional details about the exception that are possibly not present on the exception itself which can help provide context when creating the message.
        Returns:
        The string to append to the message. Note that this will not modify the original exception message but only append to the message that is delivered to the end-user.
      • message

        java.util.Optional<java.lang.String> message​(java.lang.String errorCode,
                                                     @Nullable
                                                     ExceptionDetails exceptionDetails)
        Create the message. If markdown is included, it will be rendered correctly in the UI.
        Parameters:
        errorCode - The error code. This typically comes into play when using Spring's Errors during validation, prior to throwing an exception.
        exceptionDetails - Additional details about the error that can be used to inform the message.
        Returns:
        The string to append to the message. Note that this will not modify the original exception message but only append to the message that is delivered to the end-user.