Class ExceptionMessageDecorator
- java.lang.Object
-
- com.netflix.spinnaker.kork.web.exceptions.ExceptionMessageDecorator
-
public class ExceptionMessageDecorator extends java.lang.ObjectUsed 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.Stringdecorate(java.lang.String errorCode, java.lang.String message)java.lang.Stringdecorate(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.Stringdecorate(java.lang.Throwable throwable, java.lang.String message)java.lang.Stringdecorate(java.lang.Throwable throwable, java.lang.String message, com.netflix.spinnaker.kork.api.exceptions.ExceptionDetails exceptionDetails)Decorate an exception message give the provided arguments.
-
-
-
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-Throwablemessage- The exception message (which can be different from the message on the thrown exception).exceptionDetails- AdditionalExceptionDetailsabout 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 errormessage- The message related to the error codeexceptionDetails- AdditionalExceptionDetailsabout 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)
-
-