Neurolingua commited on
Commit
f7fa94a
·
verified ·
1 Parent(s): 37364bc

Update other_function.py

Browse files
Files changed (1) hide show
  1. other_function.py +4 -4
other_function.py CHANGED
@@ -90,11 +90,11 @@ def convert_img(url, account_sid, auth_token):
90
  converted_filepath = os.path.join(UPLOAD_FOLDER, converted_filename)
91
  image.convert('RGB').save(converted_filepath, 'JPEG')
92
  return converted_filepath
 
 
 
 
93
 
94
- except requests.exceptions.HTTPError as err:
95
- print(f"HTTP error occurred: {err}")
96
- except Exception as err:
97
- print(f"An error occurred: {err}")
98
  def get_weather(city):
99
  city=city.strip()
100
  city=city.replace(' ',"+")
 
90
  converted_filepath = os.path.join(UPLOAD_FOLDER, converted_filename)
91
  image.convert('RGB').save(converted_filepath, 'JPEG')
92
  return converted_filepath
93
+
94
+ except Exception as e:
95
+ print(f"Error during image conversion: {e}")
96
+ return None
97
 
 
 
 
 
98
  def get_weather(city):
99
  city=city.strip()
100
  city=city.replace(' ',"+")