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

pl.allegro.tech.hermes.management.domain.dc.ExceptionWrapper Maven / Gradle / Ivy

There is a newer version: 2.8.0
Show newest version
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