
com.github.fridujo.rabbitmq.mock.tool.Exceptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rabbitmq-mock Show documentation
Show all versions of rabbitmq-mock Show documentation
Mock for RabbitMQ Java amqp-client
package com.github.fridujo.rabbitmq.mock.tool;
import java.util.function.Function;
public class Exceptions {
public static void runAndEatExceptions(ThrowingRunnable throwingRunnable) {
try {
throwingRunnable.run();
} catch (Exception unused) {
// we are not interested in this error
}
}
public static void runAndTransformExceptions(ThrowingRunnable throwingRunnable,
Function exceptionMapper) throws T {
try {
throwingRunnable.run();
} catch (Exception original) {
throw exceptionMapper.apply(original);
}
}
public interface ThrowingRunnable {
void run() throws Exception;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy