[SERVER-6329] Syntax errors saved from `edit` could benefit from an error message Created: 06/Jul/12  Updated: 11/Jul/16  Resolved: 04/Sep/14

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.1.0
Fix Version/s: 2.4.1

Type: Improvement Priority: Trivial - P5
Reporter: Daniel Gottlieb (Inactive) Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux


Issue Links:
Related
related to SERVER-3787 'edit' command in shell Closed
Participants:

 Description   

NB: one can put multiple statements into an `edit`. E.g. when editing a we can do:

5
b = 10

which will set a to 5 and b to 10

If the value of an `edit` in the editor has a syntax error, the remaining statements are not evaluated and there is no error message given.

E.g. when editing a:

'new_value'
b = illegal_syntax

a will take on its new value while b would stick with its old value despite no error message.

E.g. reversing the order for the syntax error when editing a:

illegal_syntax
b = 'new_value'

neither a nor b will take on new values, nor is there an error message.



 Comments   
Comment by Ramon Fernandez Marina [ 04/Sep/14 ]

MongoDB versions 2.4 and 2.6 already address this issue by printing an error message:

2014-09-04T15:49:24.846-0400 ReferenceError: illegal_syntax is not defined at tojs
error executing assignment: a = illegal_syntax
b = 10
 
> b
2014-09-04T15:49:29.470-0400 ReferenceError: b is not defined
> 

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