awacke1 commited on
Commit
8b57823
·
verified ·
1 Parent(s): 68478d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -231,7 +231,11 @@ def download_pdf(url, output_path):
231
  return True
232
  except requests.exceptions.RequestException as e:
233
  logger.error(f"Failed to download {url}: {e}")
234
- if os.path.exists(output_path): try: os.remove(output_path) except: pass
 
 
 
 
235
  return False
236
  except Exception as e:
237
  logger.error(f"An unexpected error occurred during download of {url}: {e}")
 
231
  return True
232
  except requests.exceptions.RequestException as e:
233
  logger.error(f"Failed to download {url}: {e}")
234
+ if os.path.exists(output_path):
235
+ try:
236
+ os.remove(output_path)
237
+ except:
238
+ pass
239
  return False
240
  except Exception as e:
241
  logger.error(f"An unexpected error occurred during download of {url}: {e}")