mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
Migrate NotSupportedFeatureException
This commit is contained in:
@@ -33,17 +33,30 @@
|
||||
|
||||
package sonia.scm;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
* @version 1.6
|
||||
*/
|
||||
public class NotSupportedFeatureException extends Exception {
|
||||
public class NotSupportedFeatureException extends ExceptionWithContext {
|
||||
|
||||
private static final long serialVersionUID = 256498734456613496L;
|
||||
|
||||
public NotSupportedFeatureException(String message)
|
||||
private static final String CODE = "9SR8G0kmU1";
|
||||
|
||||
public NotSupportedFeatureException(String feature)
|
||||
{
|
||||
super(message);
|
||||
super(Collections.emptyList(),createMessage(feature));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCode() {
|
||||
return CODE;
|
||||
}
|
||||
|
||||
private static String createMessage(String feature) {
|
||||
return "feature " + feature + " is not supported by this repository";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,8 +170,7 @@ public abstract class AbstractRepositoryHandler<C extends RepositoryConfig>
|
||||
@Override
|
||||
public ImportHandler getImportHandler() throws NotSupportedFeatureException
|
||||
{
|
||||
throw new NotSupportedFeatureException(
|
||||
"import handler is not supported by this repository handler");
|
||||
throw new NotSupportedFeatureException("import");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user