Last active
April 26, 2021 07:04
-
-
Save ZdenekM/9d75f40a3314f409fea36efd8ab33b71 to your computer and use it in GitHub Desktop.
How to get HTTP status code from SceneServiceException
This file contains hidden or 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
from arcor2.clients import scene_service | |
from arcor2.rest import RestHttpException | |
try: | |
scene_service.start() | |
except scene_service.SceneServiceException as e: | |
if isinstance(e.__context__, RestHttpException): | |
print(e.__context__.error_code) | |
else: | |
print("HTTP status code not available.") # a non-HTTP related error occured |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Croolman here is the promised example. Test it out and please let me know if it is sufficient.