[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: CDRIVER-1339 missing include in bson-iso8601.c
Branch: master
https://github.com/mongodb/libbson/commit/03bbb4e7e7311996e437354e258fc16e272c630a

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: CDRIVER-1339 good errors from ISO8601 parser
Branch: master
https://github.com/mongodb/libbson/commit/199ab191baa4c4031cc9671aaa0031c2d1957528

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.....

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