-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add proper SensorException
#1
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using `raise` without an argument causes an error in the Repy runtime that looks like this: ``` Uncaught exception! --- Following is a full traceback, and a user traceback. The user traceback excludes non-user modules. The most recent call is displayed last. Full debugging traceback: "repyV2/repy.py", line 177, in execute_namespace_until_completion "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/virtual_namespace.py", line 117, in evaluate "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/safe.py", line 588, in safe_run "dylink.r2py", line 547, in <module> "dylink.r2py", line 408, in dylink_dispatch "dylink.r2py", line 521, in evaluate "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/virtual_namespace.py", line 117, in evaluate "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/safe.py", line 588, in safe_run "location.r2py", line 66, in <module> "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/namespace.py", line 1220, in wrapped_function "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/namespace.py", line 218, in _handle_internalerror "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/tracebackrepy.py", line 209, in handle_internalerror "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/safe.py", line 493, in exceptionraiser User traceback: "dylink.r2py", line 547, in <module> "dylink.r2py", line 408, in dylink_dispatch "dylink.r2py", line 521, in evaluate "location.r2py", line 66, in <module> Unsafe call: ("Unsafe call '__import__' with args '('servicelogger', {'handle_internalerror': <function handle_internalerror at 0x40668130>, ``` (followed by lots of definitions available in the function scope, etc.) Patching as proposed in SeattleTestbed/repy_v2#92 (comment) shows what the actual problem is: ``` Something went wrong! --- Uncaught exception! --- Following is a full traceback, and a user traceback. The user traceback excludes non-user modules. The most recent call is displayed last. Full debugging traceback: "repyV2/repy.py", line 177, in execute_namespace_until_completion "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/virtual_namespace.py", line 117, in evaluate "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/safe.py", line 588, in safe_run "dylink.r2py", line 547, in <module> "dylink.r2py", line 408, in dylink_dispatch "dylink.r2py", line 521, in evaluate "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/virtual_namespace.py", line 117, in evaluate "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/safe.py", line 588, in safe_run "location.r2py", line 53, in <module> "sensorlib.r2py", line 107, in request_data User traceback: "dylink.r2py", line 547, in <module> "dylink.r2py", line 408, in dylink_dispatch "dylink.r2py", line 521, in evaluate "location.r2py", line 53, in <module> "sensorlib.r2py", line 107, in request_data Exception (with type 'exceptions.TypeError'): exceptions must be old-style classes or derived from BaseException, not NoneType --- ``` This commit fixes the complaint about exceptions, making the traceback look like this: ``` Uncaught exception! --- Following is a full traceback, and a user traceback. The user traceback excludes non-user modules. The most recent call is displayed last. Full debugging traceback: "repyV2/repy.py", line 177, in execute_namespace_until_completion "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/virtual_namespace.py", line 117, in evaluate "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/safe.py", line 588, in safe_run "dylink.r2py", line 547, in <module> "dylink.r2py", line 408, in dylink_dispatch "dylink.r2py", line 521, in evaluate "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/virtual_namespace.py", line 117, in evaluate "/mnt/sdcard/Android/data/com.sensibility_testbed/files/sl4a/seattle/seattle_repy/repyV2/safe.py", line 588, in safe_run "location.r2py", line 53, in <module> "sensorlib.r2py", line 114, in request_data User traceback: "dylink.r2py", line 547, in <module> "dylink.r2py", line 408, in dylink_dispatch "dylink.r2py", line 521, in evaluate "location.r2py", line 53, in <module> "sensorlib.r2py", line 114, in request_data Exception (with class '.SensorException'): java.io.IOException: Service not Available --- ```
I didn't get an error like this. When you get time, could you open Eclipse and when this call is made, see what logcat says about this call (geocode)? https://github.com/SensibilityTestbed/sensorlib/blob/master/location.r2py#L51 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Using
raise
without an argument causes an error in the Repy runtime that looks like this:(followed by lots of definitions available in the function scope, etc.)
Patching as proposed in SeattleTestbed/repy_v2#92 (comment) shows what the actual problem is:
This commit fixes the complaint about exceptions, making the traceback look like this: