com.github.cloudyrock.dimmer.exceptions.DimmerInvocationException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dimmer-core Show documentation
Show all versions of dimmer-core Show documentation
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.
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