tos_options_dashboard icon indicating copy to clipboard operation
tos_options_dashboard copied to clipboard

Feature: add error reporting

Open jj-github-jj opened this issue 2 years ago • 0 comments

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}')

jj-github-jj avatar Sep 22 '23 20:09 jj-github-jj