Search in sources :

Example 1 with HasAdditionalAttributes

use of com.netflix.spinnaker.kork.exceptions.HasAdditionalAttributes in project kork by spinnaker.

the class ExceptionSummaryService method createTraceDetail.

private TraceDetail createTraceDetail(Throwable throwable, @Nullable ExceptionDetails exceptionDetails) {
    TraceDetailBuilder detailBuilder = TraceDetail.builder().message(throwable.getMessage());
    if (throwable instanceof SpinnakerException) {
        SpinnakerException spinnakerException = (SpinnakerException) throwable;
        detailBuilder.userMessage(exceptionMessageDecorator.decorate(throwable, spinnakerException.getUserMessage(), exceptionDetails)).retryable(spinnakerException.getRetryable());
    }
    if (throwable instanceof HasAdditionalAttributes) {
        detailBuilder.additionalAttributes(((HasAdditionalAttributes) throwable).getAdditionalAttributes());
    }
    return detailBuilder.build();
}
Also used : SpinnakerException(com.netflix.spinnaker.kork.exceptions.SpinnakerException) HasAdditionalAttributes(com.netflix.spinnaker.kork.exceptions.HasAdditionalAttributes) TraceDetailBuilder(com.netflix.spinnaker.kork.api.exceptions.ExceptionSummary.TraceDetail.TraceDetailBuilder)

Aggregations

TraceDetailBuilder (com.netflix.spinnaker.kork.api.exceptions.ExceptionSummary.TraceDetail.TraceDetailBuilder)1 HasAdditionalAttributes (com.netflix.spinnaker.kork.exceptions.HasAdditionalAttributes)1 SpinnakerException (com.netflix.spinnaker.kork.exceptions.SpinnakerException)1