Class ExceptionMessageDecorator
java.lang.Object
com.netflix.spinnaker.kork.web.exceptions.ExceptionMessageDecorator
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
ConstructorsConstructorDescriptionExceptionMessageDecorator(org.springframework.beans.factory.ObjectProvider<List<com.netflix.spinnaker.kork.api.exceptions.ExceptionMessage>> exceptionMessagesProvider) -
Method Summary
Modifier and TypeMethodDescriptiondecorate(String errorCode, String message, com.netflix.spinnaker.kork.api.exceptions.ExceptionDetails exceptionDetails) Decorate an exception message give the provided arguments.decorate(Throwable throwable, String message, com.netflix.spinnaker.kork.api.exceptions.ExceptionDetails exceptionDetails) Decorate an exception message give the provided arguments.
-
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-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 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 errormessage- The message related to the error codeexceptionDetails- AdditionalExceptionDetailsabout the exception.- Returns:
- The final exception message for the end-user.
-
decorate
-
decorate
-