mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 00:45:44 +01:00
Use namespace and name for exceptions instead of technical id
This commit is contained in:
@@ -64,6 +64,7 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
import static sonia.scm.AlreadyExistsException.alreadyExists;
|
||||
import static sonia.scm.ContextEntry.ContextBuilder.entity;
|
||||
import static sonia.scm.NotFoundException.notFound;
|
||||
|
||||
@@ -149,7 +150,11 @@ public class DefaultRepositoryManager extends AbstractRepositoryManager {
|
||||
}
|
||||
}
|
||||
},
|
||||
newRepository -> repositoryDAO.contains(newRepository.getNamespaceAndName())
|
||||
newRepository -> {
|
||||
if (repositoryDAO.contains(newRepository.getNamespaceAndName())) {
|
||||
throw alreadyExists(entity(newRepository.getClass(), newRepository.getNamespaceAndName().logString()));
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user