/**
* {@link Exception} to indicate that an error occurred fetching sample data through a {@link SampleDataProvider}.
*
* @since 1.4.0
*/
public class SampleDataException extends MuleException {
/**
* Signals an unexpected exception
*/
public final static String UNKNOWN = "UNKNOWN";
/**
* Indicates that the {@link SampleDataProvider} didn't return any information
*/
public final static String NO_DATA_AVAILABLE = "NO_DATA_AVAILABLE";
/**
* Indicates that a connection couldn't be established
*/
public final static String CONNECTION_FAILURE = "CONNECTION_FAILURE";
/**
* Indicates that Sample Data resolution was attempted on a {@link Location} that doesn't exist
*/
public final static String INVALID_LOCATION = "INVALID_LOCATION";
/**
* Indicates that the Sample Data resolution was attempted but the underlying {@link SampleDataProvider} has required parameters
* that weren't supplied
*/
public final static String MISSING_REQUIRED_PARAMETERS = "MISSING_REQUIRED_PARAMETERS";
/**
* Indicates that Sample Data resolution was attempted on a component that doesn't support that capability
*/
public final static String NOT_SUPPORTED = "NOT_SUPPORTED";
/**
* Indicates that Sample Data resolution was attempted on an unregistered Extension
*/
public final static String INVALID_TARGET_EXTENSION = "INVALID_TARGET_EXTENSION";
private final String failureCode;
public SampleDataException(String message, String failureCode) {
super(createStaticMessage(message));
this.failureCode = failureCode;
}
public SampleDataException(String message, String failureCode, Throwable cause) {
super(createStaticMessage(message), cause);
this.failureCode = failureCode;
}
public SampleDataException(I18nMessage message, String failureCode) {
super(message);
this.failureCode = failureCode;
}
public SampleDataException(I18nMessage message, String failureCode, Throwable cause) {
super(message, cause);
this.failureCode = failureCode;
}
/**
* @return The failure code of the error that produced the error
*/
public String getFailureCode() {
return failureCode;
}
}