[GODRIVER-1453] mongo.NewClient does not return any error when providing invalid Mongo URI Created: 27/Dec/19 Updated: 07/Jan/20 Resolved: 07/Jan/20 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | cyan 3d | Assignee: | Divjot Arora (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Hello,
This code should return error, as I'm providing an invalid URI. But it is not returning any error, which is confusing.
|
| Comments |
| Comment by Divjot Arora (Inactive) [ 07/Jan/20 ] |
|
The URI in the example is not invalid. The driver treats "ASASASAS" as a hostname and attempts to connect to it. If you construct a client using a non-existent hostname, any operations done with that client will return a server selection error once the server selection timeout expires (30 seconds by default). |