DM 8208 Improve error handling on external task failure #233
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Testing:
Use http://localhost:8080/firefly/demo/ffapi-highlevel-charttest.html (last div) and firefly/python/SamplePythonLauncher.py to test. (In order for Firefly to access python launcher, python.exe property should be set. You can set this property in ~/gradle/build.config.
Example:
python.exe= "/path/to/myPythonLauncher.py"
These are the error conditions I have tested. (The error message appears in the last div, if everything works fine, histogram shows up - no error.)
missing property for launcher executable:
Error: java.lang.IllegalArgumentException: The python launcher path is not an executable: @python.exe@
misspelled launcher:
Error: java.lang.IllegalArgumentException: py.exe property is not defined
missing launcher executable:
Error: edu.caltech.ipac.firefly.server.query.DataAccessException: Unable to get data from external task: Failed to obtain data. /Users/tatianag/dev/miniconda/bin/python: can't open file '/Users/tatianag/dev/pynotebooks/myLauncher.py': [Errno 2] No such file or directory
no permission to read:
Error: edu.caltech.ipac.firefly.server.query.DataAccessException: Unable to get data from external task: Failed to obtain data. /Users/tatianag/dev/miniconda/bin/python: can't open file '/Users/tatianag/dev/pynotebooks/myLauncher.py': [Errno 13] Permission denied
Invalid JSON returned:
Error: edu.caltech.ipac.firefly.server.query.DataAccessException: JsonFromExternalTask Can not parse returned JSON: Unexpected character (n) at position 0.
Error in python (missing json import):
Error: edu.caltech.ipac.firefly.server.query.DataAccessException: Unable to get data from external task: Failed to obtain data. Traceback (most recent call last): File "/Users/tatianag/dev/pynotebooks/myLauncher.py", line 162, in print json.dumps(status) NameError: name 'json' is not defined
Syntax error in python:
Error: edu.caltech.ipac.firefly.server.query.DataAccessException: Unable to get data from external task: Failed to obtain data. File "/Users/tatianag/dev/pynotebooks/myLauncher.py", line 64 iimport json ^ SyntaxError: invalid syntax