Spaces:
Sleeping
Sleeping
Phillip Maraveyias commited on
Commit ·
0c4e22a
1
Parent(s): 56cd3ce
updates error handling and verbosity
Browse files
app.py
CHANGED
|
@@ -96,8 +96,8 @@ def getData(tlspc_api_key, openai_api_key):
|
|
| 96 |
cert_requests = data['certificateRequests']
|
| 97 |
while data['numFound'] > (currentPage * 1000):
|
| 98 |
currentPage += 1
|
| 99 |
-
print('Getting page ' + str(currentPage) + ': Number remaining - ' + str(
|
| 100 |
-
|
| 101 |
payload['paging']['pageNumber'] = currentPage
|
| 102 |
response = requests.post(url=cert_requests_url, headers=headers, json=payload)
|
| 103 |
data = response.json()
|
|
@@ -281,10 +281,8 @@ def getData(tlspc_api_key, openai_api_key):
|
|
| 281 |
'data_relationships_overview': data_relationships_overview}
|
| 282 |
|
| 283 |
return 'Data successfully loaded!', passed_args
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
return 'Error in loading data. Please try again.'
|
| 288 |
|
| 289 |
# User facing application
|
| 290 |
with gr.Blocks(theme='aliabid94/new-theme') as demo:
|
|
|
|
| 96 |
cert_requests = data['certificateRequests']
|
| 97 |
while data['numFound'] > (currentPage * 1000):
|
| 98 |
currentPage += 1
|
| 99 |
+
# print('Getting page ' + str(currentPage) + ': Number remaining - ' + str(
|
| 100 |
+
# data['numFound'] - currentPage * 1000))
|
| 101 |
payload['paging']['pageNumber'] = currentPage
|
| 102 |
response = requests.post(url=cert_requests_url, headers=headers, json=payload)
|
| 103 |
data = response.json()
|
|
|
|
| 281 |
'data_relationships_overview': data_relationships_overview}
|
| 282 |
|
| 283 |
return 'Data successfully loaded!', passed_args
|
| 284 |
+
except Exception as e:
|
| 285 |
+
raise e
|
|
|
|
|
|
|
| 286 |
|
| 287 |
# User facing application
|
| 288 |
with gr.Blocks(theme='aliabid94/new-theme') as demo:
|