mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-09-11 14:36:35 +03:00
Catch UnicodeEncodeError exception (#64)
This commit is contained in:
parent
6d1f22a420
commit
bf26696e71
6
files.py
6
files.py
@ -178,10 +178,14 @@ def url_uploader(supabase, vector_store):
|
|||||||
html = get_html(url)
|
html = get_html(url)
|
||||||
if html:
|
if html:
|
||||||
st.write(f"Getting content ... {url} ")
|
st.write(f"Getting content ... {url} ")
|
||||||
|
try:
|
||||||
|
file, temp_file_path = create_html_file(url, html)
|
||||||
|
except UnicodeEncodeError as e:
|
||||||
|
st.write(f"❌ Error encoding character: {e}")
|
||||||
file, temp_file_path = create_html_file(url, html)
|
file, temp_file_path = create_html_file(url, html)
|
||||||
ret = filter_file(file, supabase, vector_store)
|
ret = filter_file(file, supabase, vector_store)
|
||||||
delete_tempfile(temp_file_path, url, ret)
|
delete_tempfile(temp_file_path, url, ret)
|
||||||
else:
|
else:
|
||||||
st.write(f"❌ Failed to access to {url} .")
|
st.write(f"❌ Failed to access to {url} .")
|
||||||
else:
|
else:
|
||||||
st.write("You have reached your daily limit. Please come back later or self host the solution.")
|
st.write("You have reached your daily limit. Please come back later or self host the solution.")
|
Loading…
Reference in New Issue
Block a user