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 Details

    • message

      Optional<String> message(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

      Optional<String> message(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.