diff --git a/app/api/routes/routes.py b/app/api/routes/routes.py index 3c01a96..5ba124a 100644 --- a/app/api/routes/routes.py +++ b/app/api/routes/routes.py @@ -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')