mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
feat(backend): implement HTTP response utility functions for standardized error and success handling
This commit is contained in:
@@ -8,8 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func HTTPErrorHandler(c echo.Context, err error, options ...HTTPBaseResponseProps) error {
|
||||
statusCode := http.StatusInternalServerError
|
||||
return HTTPBaseHandler(c, WithMessage(err.Error()), WithCode(statusCode))
|
||||
return HTTPBaseHandler(c, WithMessage(err.Error()), WithCode(http.StatusBadRequest))
|
||||
}
|
||||
|
||||
type HTTPBaseResponse struct {
|
||||
Reference in New Issue
Block a user