[SERVER-19245] Shell exits with successful return code upon failure Created: 01/Jul/15  Updated: 19/Sep/15  Resolved: 01/Sep/15

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.6.5, 3.0.4
Fix Version/s: 3.1.8

Type: Bug Priority: Major - P3
Reporter: Chris Bandy Assignee: Jonathan Reams
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

→ echo "if" | mongo --quiet ; echo $?
2015-07-01T14:33:19.790-0500 E QUERY    SyntaxError: Unexpected end of input
0

Sprint: Build 7 08/10/15, Build 8 08/31/15, Build 9 (09/18/15)
Participants:

 Description   

Passing invalid Javascript to the shell prints an error message, but exits zero.

When scripting tasks, I expect the shell to exit non-zero when there are errors.



 Comments   
Comment by Githook User [ 01/Sep/15 ]

Author:

{u'username': u'jbreams', u'name': u'Jonathan Reams', u'email': u'jbreams@mongodb.com'}

Message: SERVER-19245 Make shell exit with error if last line caused an error
Branch: master
https://github.com/mongodb/mongo/commit/811f9dc1baf464e45096d4aaa10a7aae2275140a

Comment by Ramon Fernandez Marina [ 02/Jul/15 ]

Thanks for your report cbandy, I'm marking this ticket as "Needs Triage" for further consideration.

Regards,
Ramón.

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