// Path: src/main/java/com/noctarius/snowcast/SnowcastException.java
// public class SnowcastException
//         extends RuntimeException {
// 
//     /**
//      * Basic exception constructor
//      */
//     SnowcastException() {
//         super();
//     }
// 
//     /**
//      * Basic exception constructor with a given message
//      *
//      * @param message message to be used
//      */
//     public SnowcastException(@Nonnull String message) {
//         super(message);
//     }
// 
//     /**
//      * Basic exception constructor with a given message and {@link java.lang.Throwable} cause.
//      *
//      * @param message message to be used
//      * @param cause   causing throwable for this exception
//      */
//     public SnowcastException(@Nonnull String message, @Nonnull Throwable cause) {
//         super(message, cause);
//     }
// 
//     /**
//      * Basic exception constructor with a given {@link java.lang.Throwable} cause.
//      *
//      * @param cause causing throwable for this exception
//      */
//     public SnowcastException(@Nonnull Throwable cause) {
//         super(cause);
//     }
// }


import com.noctarius.snowcast.SnowcastException;
import java.util.concurrent.Callable;
import java.util.function.Function;
import java.util.function.Supplier;
        try {
            return callable.call();
        } catch (Throwable throwable) {
            if (throwable instanceof SnowcastException) {
                throw (SnowcastException) throwable;
            } else if (throwable instanceof Error) {
                throw (Error) throwable;
            }
            throw new SnowcastException(throwable);
        }
    }

    public static <V> V execute(Callable<V> callable, ExceptionMessages exceptionMessage) {
        return execute(callable, exceptionMessage, () -> EMPTY_OBJECT_ARRAY);
    }

    public static <V> V execute(Callable<V> callable, ExceptionMessages exceptionMessage,
                                Supplier<Object[]> exceptionParameterSupplier) {

        try {
            return callable.call();
        } catch (Throwable throwable) {
            Object[] parameters = exceptionParameterSupplier.get();
            String message = exceptionMessage.buildMessage(parameters);
            throw new SnowcastException(message);
        }
    }

    public interface ThrowingCallable<V> {
        V call()
// Path: src/main/java/com/noctarius/snowcast/SnowcastException.java
// public class SnowcastException
//         extends RuntimeException {
// 
//     /**
//      * Basic exception constructor
//      */
//     SnowcastException() {
//         super();
//     }
// 
//     /**
//      * Basic exception constructor with a given message
//      *
//      * @param message message to be used
//      */
//     public SnowcastException(@Nonnull String message) {
//         super(message);
//     }
// 
//     /**
//      * Basic exception constructor with a given message and {@link java.lang.Throwable} cause.
//      *
//      * @param message message to be used
//      * @param cause   causing throwable for this exception
//      */
//     public SnowcastException(@Nonnull String message, @Nonnull Throwable cause) {
//         super(message, cause);
//     }
// 
//     /**
//      * Basic exception constructor with a given {@link java.lang.Throwable} cause.
//      *
//      * @param cause causing throwable for this exception
//      */
//     public SnowcastException(@Nonnull Throwable cause) {
//         super(cause);
//     }
// }


// Path: src/main/java/com/noctarius/snowcast/impl/ExceptionUtils.java
import com.noctarius.snowcast.SnowcastException;
import java.util.concurrent.Callable;
import java.util.function.Function;
import java.util.function.Supplier;

        try {
            return callable.call();
        } catch (Throwable throwable) {
            if (throwable instanceof SnowcastException) {
                throw (SnowcastException) throwable;
            } else if (throwable instanceof Error) {
                throw (Error) throwable;
            }
            throw new SnowcastException(throwable);
        }
    }

    public static <V> V execute(Callable<V> callable, ExceptionMessages exceptionMessage) {
        return execute(callable, exceptionMessage, () -> EMPTY_OBJECT_ARRAY);
    }

    public static <V> V execute(Callable<V> callable, ExceptionMessages exceptionMessage,
                                Supplier<Object[]> exceptionParameterSupplier) {

        try {
            return callable.call();
        } catch (Throwable throwable) {
            Object[] parameters = exceptionParameterSupplier.get();
            String message = exceptionMessage.buildMessage(parameters);
            throw new SnowcastException(message);
        }
    }

    public interface ThrowingCallable<V> {
        V call()
                throws Throwable;