-
Type:
Improvement
-
Resolution: Done
-
Priority:
Minor - P4
-
Affects Version/s: 2.11.2
-
Component/s: Error Handling
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
import com.mongodb.MongoClient;
public class MongoTest {
public static void main(String[] args) throws Exception {
new MongoClient("http://something.com");
}
}
Exception in thread "main" java.lang.NumberFormatException: For input string: "//something.com"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:481)
at java.lang.Integer.parseInt(Integer.java:527)
at com.mongodb.ServerAddress.<init>(ServerAddress.java:67)
at com.mongodb.ServerAddress.<init>(ServerAddress.java:46)
at com.mongodb.MongoClient.<init>(MongoClient.java:93)
at MongoTest.main(MongoTest.java:7)
Expected behavior: throw a more relevant exception, or at least a MongoException.