Class ExceptionMessageDecorator

java.lang.Object
com.netflix.spinnaker.kork.web.exceptions.ExceptionMessageDecorator

public class ExceptionMessageDecorator extends Object
Used to add additional information to an exception message. Messages on exceptions are immutable, so this is mostly used when a message is pulled from an exception prior to being sent to an end-user.
  • Constructor Details

    • ExceptionMessageDecorator

      public ExceptionMessageDecorator(org.springframework.beans.factory.ObjectProvider<List<com.netflix.spinnaker.kork.api.exceptions.ExceptionMessage>> exceptionMessagesProvider)
  • Method Details

    • decorate

      public String decorate(Throwable throwable, String message, @Nullable com.netflix.spinnaker.kork.api.exceptions.ExceptionDetails exceptionDetails)
      Decorate an exception message give the provided arguments.
      Parameters:
      throwable - Throwable
      message - The exception message (which can be different from the message on the thrown exception).
      exceptionDetails - Additional ExceptionDetails about the exception.
      Returns:
      The final exception message for the end-user.
    • decorate

      public String decorate(String errorCode, String message, @Nullable com.netflix.spinnaker.kork.api.exceptions.ExceptionDetails exceptionDetails)
      Decorate an exception message give the provided arguments.
      Parameters:
      errorCode - The error code, typically from a validation error
      message - The message related to the error code
      exceptionDetails - Additional ExceptionDetails about the exception.
      Returns:
      The final exception message for the end-user.
    • decorate

      public String decorate(Throwable throwable, String message)
    • decorate

      public String decorate(String errorCode, String message)