fix: correct HTTP status codes and error handling in remaining handlers

- createPlaylistHandler: 200 → 201 Created, service errors → 500
- createSiteHandler: service/DB errors → 500 (was 400)
- saveStorageConfigHandler: service errors → 500 (was 400)
- SchedulerHandler.RunTask: task errors → 500 (was 400 with ErrInternal)
- aria2StatsHandler: service errors → 500 (was 400)
- organizeMediaHandler: service errors → 500 (was 400)
- testDownloadClientHandler: test failure → 200 with ok:false (was 400)
- testStorageConfigHandler: test failure → 200 with ok:false (was 400)

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
soldosluka857
2026-05-30 02:47:57 +00:00
committed by Shuke
parent 260cc164a0
commit 4e5797f1f4
6 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ func (h *SchedulerHandler) RunTask(c *gin.Context) {
ctx := c.Request.Context()
if err := h.svc.Scheduler.RunNow(ctx, name); err != nil {
Error(c, http.StatusBadRequest, ErrInternal, "任务执行失败: "+err.Error())
Error(c, http.StatusInternalServerError, ErrInternal, "任务执行失败: "+err.Error())
return
}