All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dell.cpsd.common.rabbitmq.exceptions.ExceptionLogTransformer Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
/**
 * Copyright © 2017 Dell Inc. or its subsidiaries.  All Rights Reserved.
 * Dell EMC Confidential/Proprietary Information
 */


package com.dell.cpsd.common.rabbitmq.exceptions;

import com.dell.cpsd.common.rabbitmq.retrypolicy.exception.ErrorResponseException;
import org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException;

/**
 * Prepares exception for logs: strips wrapper exceptions that bring no useful context.
 * 

* Copyright © 2017 Dell Inc. or its subsidiaries. All Rights Reserved. * Dell EMC Confidential/Proprietary Information *

*/ public class ExceptionLogTransformer { public Throwable transform(Throwable cause) { if (cause instanceof ListenerExecutionFailedException && cause.getCause() != null) { cause = cause.getCause(); } if (cause instanceof ErrorResponseException && cause.getCause() != null) { cause = cause.getCause(); } return cause; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy