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

Feature: add error reporting #3

Open
jj-github-jj opened this issue Sep 22, 2023 · 0 comments
Open

Feature: add error reporting #3

jj-github-jj opened this issue Sep 22, 2023 · 0 comments

Comments

@jj-github-jj
Copy link

jj-github-jj commented Sep 22, 2023

the update_search function should add error reporting. Currently there is no indication of why the UI doesnt accept ticker values which can happen if the API_KEY is invalid.

  def update_search(search_value, ticker_switch, value):  
        print ('search value',search_value, 'ticker',ticker_switch, value)
       

        if not search_value:
            print ('preventing updates')
            raise PreventUpdate
        
        if ticker_switch:
            json_data = tos_search(search_value, projection='symbol-search', apiKey=API_KEY)
        else:
            json_data = tos_search(search_value, projection='desc-search', apiKey=API_KEY)
        
        if 'error' in json_data:
            print (f'Error in query results. Possible API key issues: json_data erturned: {json_data}')
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