Spaces:
Running
Running
update exception message
Browse files
app.py
CHANGED
@@ -14,7 +14,6 @@ vectorizer = joblib.load("vectorizer.joblib") # global vocabulary
|
|
14 |
# tokenizer = joblib.load(tokenizer)
|
15 |
|
16 |
def crawURL(url):
|
17 |
-
print(f"Crawling page: {url}")
|
18 |
# Fetch the sitemap
|
19 |
response = requests.get(sitemap_url)
|
20 |
# Parse the sitemap HTML
|
@@ -87,8 +86,8 @@ def categorize(url):
|
|
87 |
result = process_api(article_content)
|
88 |
print("inside try result", result)
|
89 |
return result
|
90 |
-
except:
|
91 |
-
return {"error_message":
|
92 |
|
93 |
url = st.text_input("enter your CNN's URL here")
|
94 |
|
|
|
14 |
# tokenizer = joblib.load(tokenizer)
|
15 |
|
16 |
def crawURL(url):
|
|
|
17 |
# Fetch the sitemap
|
18 |
response = requests.get(sitemap_url)
|
19 |
# Parse the sitemap HTML
|
|
|
86 |
result = process_api(article_content)
|
87 |
print("inside try result", result)
|
88 |
return result
|
89 |
+
except Exception as error:
|
90 |
+
return {"error_message": error.message}
|
91 |
|
92 |
url = st.text_input("enter your CNN's URL here")
|
93 |
|