Skip to content

Commit

Permalink
Add more exception info
Browse files Browse the repository at this point in the history
  • Loading branch information
minborg committed Jan 29, 2016
1 parent 999aac6 commit d41c2f5
Showing 1 changed file with 11 additions and 2 deletions.
Expand Up @@ -32,6 +32,7 @@
import com.speedment.exception.SpeedmentException;
import static com.speedment.util.StaticClassUtil.instanceNotAllowed;
import com.speedment.util.StreamComposition;
import static java.util.stream.Collectors.joining;
import java.util.stream.Stream;

/**
Expand All @@ -41,8 +42,16 @@
public final class DocumentDbUtil {

public static DbmsType dbmsTypeOf(Speedment speedment, Dbms dbms) {
return speedment.getDbmsHandlerComponent().findByName(dbms.getTypeName())
.orElseThrow(() -> new SpeedmentException("Unable to find the database type " + dbms.getTypeName()));
final String typeName = dbms.getTypeName();
return speedment.getDbmsHandlerComponent().findByName(typeName)
.orElseThrow(() -> new SpeedmentException(
"Unable to find the database type "
+ typeName
+ ". The installed types are: "
+ speedment.getDbmsHandlerComponent().supportedDbmsTypes()
.map(DbmsType::getName)
.collect(joining(", "))
));
}

public static Stream<? extends Document> traverseOver(Project project) {
Expand Down

0 comments on commit d41c2f5

Please sign in to comment.