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

com.github.cloudyrock.dimmer.exceptions.DimmerInvocationException Maven / Gradle / Ivy

Go to download

Lightweight library to manage feature toggling. Unlike others Dimmer doesn't work in switch mode, black or white, It provides a flexible way to respond to disabled features by adding customizable behaviours and pre-configured responses.

There is a newer version: 2.2.2
Show newest version
package com.github.cloudyrock.dimmer.exceptions;

import com.github.cloudyrock.dimmer.FeatureInvocation;

/**
 * Default exception that will be thrown if no other is configured.
 * It's thrown at runtime represents a desired behaviour of throwing an exception.
 *
 * @author Antonio Perez Dieppa
 * @since 11/06/2018
 */
public class DimmerInvocationException extends RuntimeException {

    private static final long serialVersionUID = 159403250595728227L;
    private final FeatureInvocation invocationInfo;

    public DimmerInvocationException(FeatureInvocation featureInvocation) {
        this.invocationInfo = featureInvocation;
    }

    public FeatureInvocation getInvocationInfo() {
        return invocationInfo;
    }

    @Override
    public String getMessage() {
        return String.format(">>> Feature %s not available for %s.%s(...)",
                invocationInfo.getFeature(),
                invocationInfo.getDeclaringType().getCanonicalName(),
                invocationInfo.getMethodName());
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy