Skip to content

Commit 6745193

Browse files
author
iwysiu
committed
GODRIVER-1086 don't return the uri when parsing fails
Change-Id: Ia7ce0035da57defa49359cb1c134d32507505210
1 parent 982e8c6 commit 6745193

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mongo/options/clientoptions_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func TestClientOptions(t *testing.T) {
2828
t.Run("ApplyURI/doesn't overwrite previous errors", func(t *testing.T) {
2929
uri := "not-mongo-db-uri://"
3030
want := internal.WrapErrorf(
31-
errors.New(`scheme must be "mongodb" or "mongodb+srv"`), "error parsing uri (%s)", "not-mongo-db-uri://",
31+
errors.New(`scheme must be "mongodb" or "mongodb+srv"`), "error parsing uri",
3232
)
3333
co := Client().ApplyURI(uri).ApplyURI("mongodb://localhost/")
3434
got := co.Validate()
@@ -177,7 +177,7 @@ func TestClientOptions(t *testing.T) {
177177
"ParseError",
178178
"not-mongo-db-uri://",
179179
&ClientOptions{err: internal.WrapErrorf(
180-
errors.New(`scheme must be "mongodb" or "mongodb+srv"`), "error parsing uri (%s)", "not-mongo-db-uri://",
180+
errors.New(`scheme must be "mongodb" or "mongodb+srv"`), "error parsing uri",
181181
)},
182182
},
183183
{

x/network/connstring/connstring.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func Parse(s string) (ConnString, error) {
2626
var p parser
2727
err := p.parse(s)
2828
if err != nil {
29-
err = internal.WrapErrorf(err, "error parsing uri (%s)", s)
29+
err = internal.WrapErrorf(err, "error parsing uri")
3030
}
3131
return p.ConnString, err
3232
}

0 commit comments

Comments
 (0)