try catcg
This commit is contained in:
@@ -142,7 +142,14 @@ def upload_file():
|
||||
filename = secure_filename(file.filename)
|
||||
final_save_path = os.path.join(UPLOAD_FOLDER, filename)
|
||||
logger.info(f'POST CALLED 6 {final_save_path}')
|
||||
file.save(final_save_path)
|
||||
|
||||
try:
|
||||
file.save(final_save_path)
|
||||
except Exception as e:
|
||||
# Catches any other exception and stores the message in 'e'
|
||||
print(f"An unexpected error occurred: {e}")
|
||||
|
||||
|
||||
if request.method == 'GET':
|
||||
logger.info('GET CALLED')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user