[SERVER-277] Helpful error message when trying to eval something which isn't code Created: 03/Sep/09  Updated: 12/Jul/16  Resolved: 07/Sep/09

Status: Closed
Project: Core Server
Component/s: JavaScript, Shell, Stability
Affects Version/s: None
Fix Version/s: 1.1.0

Type: Improvement Priority: Major - P3
Reporter: sandstrom Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Would be nice to have the server to not die when trying to eval something which it can't eval.

// SHELL

var invalid = {};
db.eval(invalid.reference);
Thu Sep 3 14:07:39 JS Error: Error: error doing query: failed (anon):118

// MONGO DAEMON
db/dbeval.cpp:41: failed assertion `e.type() == Code || e.type() == CodeWScope || e.type() == String'
Thu Sep 3 14:07:39 Got signal: 6 (Abort trap).
Thu Sep 3 14:07:39 Last op: { opid: 2, active: 1, secs_running: 0, op: "query", ns: "test.$cmd", query: "

{ $eval: undefined }

", inLock: 1, client: "127.0.0.1:50082" }
Thu Sep 3 14:07:39 Backtrace:
0x13ada8 0x965622bb 0xffffffff 0x3ed26 0x13876b 0x13d012 0x13d6b4 0x143e3c 0x2216
0 mongod 0x0013ada8 _ZN5mongo10abruptQuitEi + 1448
1 libSystem.B.dylib 0x965622bb _sigtramp + 43
2 ??? 0xffffffff 0x0 + 4294967295
3 mongod 0x0003ed26 _ZN5mongo8Listener6listenEv + 134
4 mongod 0x0013876b _ZN5mongo6listenEi + 699
5 mongod 0x0013d012 _ZN5mongo14_initAndListenEiPKc + 1282
6 mongod 0x0013d6b4 _ZN5mongo13initAndListenEiPKc + 36
7 mongod 0x00143e3c main + 26364
8 mongod 0x00002216 start + 54
Thu Sep 3 14:07:39 dbexit:
Thu Sep 3 14:07:39 closeAllFiles() finished
Thu Sep 3 14:07:39 dbexit: really exiting now
Abort trap



 Comments   
Comment by Eliot Horowitz (Inactive) [ 15/Sep/09 ]

released in 1.1.0

Generated at Thu Feb 08 02:53:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.