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

In Exception handling response value is not define. #10

Open
darshankhuntjainam opened this issue Nov 25, 2023 · 1 comment
Open

In Exception handling response value is not define. #10

darshankhuntjainam opened this issue Nov 25, 2023 · 1 comment

Comments

@darshankhuntjainam
Copy link

When We call any function like xt.get_option_symbol() and if it goes to Execption, the below error shows.

File "/home/Admin/Desktop/xts-pythonclient/Connect.py", line 716, in get_option_symbol
return response['description']
UnboundLocalError: local variable 'response' referenced before assignment

@darshankhuntjainam
Copy link
Author

Here is the solution to above error:

Import the traceback library and change the below code.
except Exception as e:
err_msg = traceback.format_exception(e)
return err_msg

@darshankhuntjainam darshankhuntjainam changed the title In Exception handling resonce value is not define. In Exception handling response value is not define. Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant