Skip to content

Commit

Permalink
增加 /confirm 接口的日志提示
Browse files Browse the repository at this point in the history
  • Loading branch information
HisAtri committed Oct 13, 2024
1 parent 3e63910 commit 736bd09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ def set_tag():
try:
tag.write(tags=tags_to_set, file=audio_path)
except TypeError as e:
logger.error(f"TypeError at endpoint /confirm: {str(e)}")
return {"code": 524, "error": str(e)}, 524
except FileNotFoundError as e:
logger.error(f"Error at endpoint /confirm: {audio_path} file not found.")
return {"code": 404, "error": str(e)}, 404
except Exception as e:
logger.error(f"Unknown Error at endpoint /confirm: {str(e)}")
return {"code": 500, "error": str(e)}, 500
return {"code": 200, "log": f"Successfully edited file {audio_path}"}, 200

0 comments on commit 736bd09

Please sign in to comment.