This commit is contained in:
gr-dv committed 2026-11-25 18:30:00 +03:00
1 parent 6bf8c4e6e3
commit 49ddbc5531
9 files changed
+30 -31

No files matched your search

+1 -6
View File
@@ -3,7 +3,6 @@ package httperrors
import (
"net/http"
"github.com/txix-open/isp-kit/errors"
"github.com/txix-open/isp-kit/json"
)
@@ -34,11 +33,7 @@ func (e *HttpError) WriteError(w http.ResponseWriter) error {
"errorMessage": e.userMessage,
"details": e.details,
}
err := json.NewEncoder(w).Encode(data)
if err != nil {
return errors.WithMessage(err, "json encode error")
}
return nil
return json.NewEncoder(w).Encode(data)
}
func (e *HttpError) WithDetails(details ...any) {