[CSHARP-610] FormatException message in MongoServerAddress.Parse Created: 22/Oct/12  Updated: 20/Mar/14  Resolved: 04/Nov/12

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.6
Fix Version/s: 1.7

Type: Bug Priority: Trivial - P5
Reporter: Nik Kolev Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The message to FormatException uses a string "formatter" but fails to call String.Format and provide the parameter value.



 Comments   
Comment by auto [ 06/Nov/12 ]

Author:

{u'date': u'2012-11-02T20:43:15Z', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-610: merged pull request 134 and added more unit tests.
Branch: x2.0
https://github.com/mongodb/mongo-csharp-driver/commit/e01118a77435cd9a2d851bef5c49fcfb98319824

Comment by auto [ 06/Nov/12 ]

Author:

{u'date': u'2012-10-22T22:28:30Z', u'email': u'nik.kolev@sig.com', u'name': u'Nik Kolev'}

Message: CSHARP-610 Invalid server address message.

Fixes the FormatException message in the path in
MongoServerAddress::Parse where the provided 'url' does not pass
the ::TryParse criteria for correctness. The intent was to provide
the offending value in the message, but the developer forgot to
fill in the

{0}

placeholder.
Branch: x2.0
https://github.com/mongodb/mongo-csharp-driver/commit/c3081730e6638db0aca762fd163fc3ae394e41b7

Comment by auto [ 05/Nov/12 ]

Author:

{u'date': u'2012-11-02T20:43:15Z', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-610: merged pull request 134 and added more unit tests.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/566c6b56e8fe2782f6c2298ba8d101a5dfab8047

Comment by auto [ 05/Nov/12 ]

Author:

{u'date': u'2012-10-22T22:28:30Z', u'email': u'nik.kolev@sig.com', u'name': u'Nik Kolev'}

Message: CSHARP-610 Invalid server address message.

Fixes the FormatException message in the path in
MongoServerAddress::Parse where the provided 'url' does not pass
the ::TryParse criteria for correctness. The intent was to provide
the offending value in the message, but the developer forgot to
fill in the

{0}

placeholder.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/a059c7c13a223e85ce3282c111b1047a0e5b1f9e

Comment by Nik Kolev [ 23/Oct/12 ]

I have submitted a pull request that fixes the issue: https://github.com/mongodb/mongo-csharp-driver/pull/134

If you pull the tests I added from the commit here: https://github.com/gv0tch0/mongo-csharp-driver/commit/b59f55abed1d41dd6f0bb07beede8762268b7969 and run them you'll get "code to reproduce" (granted of course you don't pull the change to MongoServerAddress). If you comment out the ExpectedException in said tests you can see an exception stacktrace.

Comment by Craig Wilson [ 22/Oct/12 ]

Would you mind posting a stacktrace, or some code to reproduce?

Generated at Wed Feb 07 21:37:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.