Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mantid return codes #9530

Closed
peterfpeterson opened this issue Jan 8, 2014 · 1 comment
Closed

Mantid return codes #9530

peterfpeterson opened this issue Jan 8, 2014 · 1 comment
Assignees
Labels
Framework Issues and pull requests related to components in the Framework
Milestone

Comments

@peterfpeterson
Copy link
Member

Currently mantid always returns 0 on exit. Change it so when something goes wrong it gives a different return code. A specific example is a python script which should never work under any conditions (fail.py):

#!python
blah

Executing this (in linux) and printing the result gives

MantidPlot -xq fail.py ; echo $?
ConfigService-[Information] This is Mantid version 3.0.20140108.1658 revision g5a8aa54
ConfigService-[Information] Properties file(s) loaded: /home/pf9/builds/mantid-release/bin/Mantid.properties, /home/pf9/.mantid/Mantid.user.properties
ConfigService-[Information] Logging to: /home/pf9/.mantid/mantid.log
FrameworkManager-[Notice] Welcome to Mantid version 3.0.20140108.1658 - Manipulation and Analysis Toolkit for Instrument Data
FrameworkManager-[Notice] Please cite Mantid in your publications using: http://dx.doi.org/10.5286/Software/Mantid
ConfigService-[Information] ParaView is available
MantidUI-[Notice] MantidPlot is shutting down...
0

which gives no indication that a failure happened. Running this same script through the python interpreter gives

python fail.py ; echo $?
Traceback (most recent call last):
  File "fail.py", line 1, in `<module>`
    blah
NameError: name 'blah' is not defined
1

Similarly a script (pass.py) should return 0:

#!python
import sys
sys.exit(0)

This ticket is to give more meaningful failure feedback when using the "-xq" flag on the command line.

@peterfpeterson peterfpeterson added the Framework Issues and pull requests related to components in the Framework label Jun 3, 2015
@peterfpeterson peterfpeterson self-assigned this Jun 3, 2015
@peterfpeterson peterfpeterson added this to the Release 3.1 milestone Jun 3, 2015
@peterfpeterson
Copy link
Member Author

This issue was originally trac ticket 8686

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues and pull requests related to components in the Framework
Projects
None yet
Development

No branches or pull requests

1 participant