pl.allegro.tech.hermes.management.domain.dc.ExceptionWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-management Show documentation
Show all versions of hermes-management Show documentation
Fast and reliable message broker built on top of Kafka.
package pl.allegro.tech.hermes.management.domain.dc;
import pl.allegro.tech.hermes.common.exception.HermesException;
import pl.allegro.tech.hermes.common.exception.InternalProcessingException;
class ExceptionWrapper {
static RuntimeException wrapInInternalProcessingExceptionIfNeeded(
Exception toWrap, String command, String dcName) {
if (toWrap instanceof HermesException) {
return (HermesException) toWrap;
}
return new InternalProcessingException(
"Execution of command '" + command + "' failed on DC '" + dcName + "'.", toWrap);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy