[SERVER-8618] Add context to JavaScript errors reported by v8 Created: 19/Feb/13  Updated: 11/Jul/16  Resolved: 20/Feb/13

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: None
Fix Version/s: 2.4.0-rc1

Type: Bug Priority: Major - P3
Reporter: Ben Becker Assignee: Ben Becker
Resolution: Done Votes: 0
Labels: Javasc, v8
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-8926 Shell displays "JavaScript execution ... Closed
Operating System: ALL
Participants:

 Description   

Currently, JS error messages are very confusing for users; e.g.:

Tue Feb 19 11:40:29.554 [conn3] JavaScript execution failed: SyntaxError: Unexpected identifier _funcs9:1

This is partially because we specify an arbitrary variable name (e.g. funcs9) as the script context/filename in V8Scope::_createFunction(). This should either be removed, or toSTLString(v8::TryCatch*) should access the code from the scope's map and parse the start/end position to provide the context reported by v8.



 Comments   
Comment by auto [ 20/Feb/13 ]

Author:

{u'date': u'2013-02-20T20:12:00Z', u'name': u'Ben Becker', u'email': u'ben.becker@10gen.com'}

Message: SERVER-8618: clean up shell and file exception messages
Branch: master
https://github.com/mongodb/mongo/commit/c8828dea771690082f949a367ac920aa7e463262

Comment by auto [ 20/Feb/13 ]

Author:

{u'date': u'2013-02-20T17:56:24Z', u'name': u'Ben Becker', u'email': u'ben.becker@10gen.com'}

Message: SERVER-8618: fix windows build
Branch: master
https://github.com/mongodb/mongo/commit/7817175b3cc03b9da8ac1b38690ec321f16a6f68

Comment by auto [ 20/Feb/13 ]

Author:

{u'date': u'2013-02-20T17:15:46Z', u'name': u'Ben Becker', u'email': u'ben.becker@10gen.com'}

Message: SERVER-8618: add context to JS exception messages
Branch: master
https://github.com/mongodb/mongo/commit/f11d2b67e2f185a0934d76cca21361b0679e5301

Generated at Thu Feb 08 03:17:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.