m8chaa commited on
Commit
8a662e2
·
verified ·
1 Parent(s): 1703e83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -300,7 +300,11 @@ async def mobile_process_receipts(background_tasks: BackgroundTasks, sheeturl: s
300
  async with httpx.AsyncClient(follow_redirects=True, timeout=timeout) as client:
301
  response = await client.post(appsScriptsURL, json=body)
302
  print(response)
303
- print(response.json())
 
 
 
 
304
  if response.status_code != 200:
305
  logging.error(f"Unexpected response from Google Apps Script API: {response.status_code} - {response.text}")
306
  raise HTTPException(status_code=500, detail="Error in trying to connect to your sheet. Please try again.")
 
300
  async with httpx.AsyncClient(follow_redirects=True, timeout=timeout) as client:
301
  response = await client.post(appsScriptsURL, json=body)
302
  print(response)
303
+ if response.content:
304
+ print(response.json())
305
+ else:
306
+ print("Empty response")
307
+ return {"message": "No documents were found."}
308
  if response.status_code != 200:
309
  logging.error(f"Unexpected response from Google Apps Script API: {response.status_code} - {response.text}")
310
  raise HTTPException(status_code=500, detail="Error in trying to connect to your sheet. Please try again.")