[SERVER-10177] Javascript code should throw instances of Error instead of strings. Created: 11/Jul/13 Updated: 04/Sep/14 Resolved: 23/May/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | JavaScript, Shell |
| Affects Version/s: | None |
| Fix Version/s: | 2.7.1 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andy Schwerin | Assignee: | David Hows |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Sprint: | Server 2.7.1 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
Instances of Error have a stack trace in addition to a message, which could then be printed if the exception reaches the top of the call stack. Presently, the MongoDB javascript code in the shell and in the server throws a mix of strings and Errors. |
| Comments |
| Comment by Githook User [ 22/May/14 ] | ||||||||||
|
Author: {u'username': u'daveh86', u'name': u'daveh86', u'email': u'howsdav@gmail.com'}Message: Includes both the initial patch to remove all throws and patches for all failing tests Signed-off-by: Benety Goh <benety@mongodb.com> | ||||||||||
| Comment by Andy Schwerin [ 01/May/14 ] | ||||||||||
|
Run the following "grep" from a shell at the root of the git repo to find many/all guilty lines. Around 90 as of 2014-May-01.
| ||||||||||
| Comment by Eric Daniels (Inactive) [ 25/Jul/13 ] | ||||||||||
|
Had to assign self to stop progress | ||||||||||
| Comment by auto [ 20/Jul/13 ] | ||||||||||
|
Author: {u'username': u'tadmarshall', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}Message: Restore the exception object field that the test is looking for. | ||||||||||
| Comment by auto [ 19/Jul/13 ] | ||||||||||
|
Author: {u'username': u'monkey101', u'name': u'Dan Pasette', u'email': u'dan@10gen.com'}Message: | ||||||||||
| Comment by Scott Hernandez (Inactive) [ 11/Jul/13 ] | ||||||||||
|
For things with structured data, like bson from the server, we can write a helper to attach the embedded object/bson like so:
|