From 3237923f0205dd59c3a980d777e500ca0e665f09 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Mon, 17 Feb 2025 16:27:39 +0800 Subject: [PATCH] fix: prevent unnecessary error handling in export download endpoint Adds an early return after handling bad request errors in the GetExportDownload function to avoid unnecessary error processing and improve error handling clarity. --- core/controllers/export.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/controllers/export.go b/core/controllers/export.go index 8fff7305..e4c022eb 100644 --- a/core/controllers/export.go +++ b/core/controllers/export.go @@ -68,6 +68,7 @@ func GetExportDownload(c *gin.Context) { exp, err = export.GetJsonService().GetExport(exportId) default: HandleErrorBadRequest(c, errors.New(fmt.Sprintf("invalid export type: %s", exportType))) + return } if err != nil { HandleErrorInternalServerError(c, err)