[CDRIVER-1339] Descriptive error when JSON $date lacks timezone Created: 21/Jun/16 Updated: 13/Dec/16 Resolved: 13/Dec/16 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | json, libbson |
| Affects Version/s: | None |
| Fix Version/s: | 1.6.0 |
| Type: | Improvement | Priority: | Trivial - P5 |
| Reporter: | Shane Harvey | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | intern2016 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
The Mongo extended JSON documentation states that $date has a "mandatory time zone field." libbson follows this and does not allow dates without time zones such as "1970-01-01T00:00:00.000" Return a better error message than "Could not parse "1970-01-01T00:00:00.000" as a date"? Maybe "Could not parse "1970-01-01T00:00:00.000" missing time zone". |
| Comments |
| Comment by Githook User [ 13/Dec/16 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: |
| Comment by Githook User [ 13/Dec/16 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: |
| Comment by Hannes Magnusson [ 27/Jun/16 ] |
|
I don't think we should allow times without timezones. not sure how trivial it would be to improve the error message to say why it can't be parsed. its a parse error. trying to guess how to fix it is a deep hole..... |