Romeo David commited on
Commit
aac7ba2
·
1 Parent(s): 17a7d49

fixed error message

Browse files
Files changed (1) hide show
  1. pages/output.py +5 -5
pages/output.py CHANGED
@@ -39,24 +39,24 @@ def write_table(website_and_tools_data):
39
 
40
  # Handle case if data is not a list (e.g., a single dictionary)
41
  elif isinstance(parsed_data, dict):
42
- st.write("Website and Tools Analysis Result (Summary):")
43
  # You might want to display dictionary data differently
44
  st.json(parsed_data) # Example: Display as JSON
45
  else:
46
- st.warning("Website and Tools data is not in the expected list format.")
47
  st.write(parsed_data) # Show the raw data
48
 
49
  except json.JSONDecodeError:
50
- st.error("Error: Could not parse the Website and Tools data as JSON.")
51
  st.text(website_and_tools_data) # Show the raw string data
52
  except AttributeError:
53
  st.error("Error: Could not find expected keys ('category', 'current_footprint', 'best_of_breed_solution') in the data.")
54
  st.write(parsed_data) # Show the data that caused the error
55
  except Exception as e:
56
- st.error(f"An unexpected error occurred while processing Website and Tools data: {e}")
57
  st.write(website_and_tools_data) # Show the raw data
58
  else:
59
- st.warning("No data retrieved for Website and Tools analysis.")
60
  # --- End: Loop and display data ---
61
 
62
 
 
39
 
40
  # Handle case if data is not a list (e.g., a single dictionary)
41
  elif isinstance(parsed_data, dict):
42
+ st.write("Analysis Result (Summary):")
43
  # You might want to display dictionary data differently
44
  st.json(parsed_data) # Example: Display as JSON
45
  else:
46
+ st.warning("data is not in the expected list format.")
47
  st.write(parsed_data) # Show the raw data
48
 
49
  except json.JSONDecodeError:
50
+ st.error("Error: Could not parse the data as JSON.")
51
  st.text(website_and_tools_data) # Show the raw string data
52
  except AttributeError:
53
  st.error("Error: Could not find expected keys ('category', 'current_footprint', 'best_of_breed_solution') in the data.")
54
  st.write(parsed_data) # Show the data that caused the error
55
  except Exception as e:
56
+ st.error(f"An unexpected error occurred while processing data: {e}")
57
  st.write(website_and_tools_data) # Show the raw data
58
  else:
59
+ st.warning("No data retrieved for analysis.")
60
  # --- End: Loop and display data ---
61
 
62