Class ExceptionMessageDecorator


  • public class ExceptionMessageDecorator
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      ExceptionMessageDecorator​(org.springframework.beans.factory.ObjectProvider<java.util.List<com.netflix.spinnaker.kork.api.exceptions.ExceptionMessage>> exceptionMessagesProvider)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String decorate​(java.lang.String errorCode, java.lang.String message)  
      java.lang.String decorate​(java.lang.String errorCode, java.lang.String message, com.netflix.spinnaker.kork.api.exceptions.ExceptionDetails exceptionDetails)
      Decorate an exception message give the provided arguments.
      java.lang.String decorate​(java.lang.Throwable throwable, java.lang.String message)  
      java.lang.String decorate​(java.lang.Throwable throwable, java.lang.String message, com.netflix.spinnaker.kork.api.exceptions.ExceptionDetails exceptionDetails)
      Decorate an exception message give the provided arguments.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExceptionMessageDecorator

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

      • decorate

        public java.lang.String decorate​(java.lang.Throwable throwable,
                                         java.lang.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 java.lang.String decorate​(java.lang.String errorCode,
                                         java.lang.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 java.lang.String decorate​(java.lang.Throwable throwable,
                                         java.lang.String message)
      • decorate

        public java.lang.String decorate​(java.lang.String errorCode,
                                         java.lang.String message)