Skip to content

Commit

Permalink
#662 throw ISE if no PM is found
Browse files Browse the repository at this point in the history
  • Loading branch information
amihaiemil committed Nov 4, 2020
1 parent 822a2e5 commit af31418
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions self-core-impl/src/main/java/com/selfxdsd/core/BaseRepo.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,16 @@ public Project activate() {
if (isActive) {
throw new RepoException.AlreadyActive(this.fullName());
}
final Project project = this.storage()
.projectManagers()
.pick(provider())
.assign(this);
final String provider = this.provider();
final ProjectManager manager = this.storage.projectManagers()
.pick(provider);
if(manager == null) {
throw new IllegalStateException(
"No Project Manager found for the " + provider + " Provider. "
+ "Ask the system admin to register one!"
);
}
final Project project = manager.assign(this);
final Wallets wallets = project.wallets();
final Wallet wallet = wallets.register(
project,
Expand Down

0 comments on commit af31418

Please sign in to comment.