Skip to content

Commit

Permalink
package refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
cmazx committed Aug 15, 2022
1 parent b4029eb commit 53c0759
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions swerrors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ func (e *Response) SetPayload(payload *models.Error) {
func (e Response) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(e.HTTPStatus())
if e.Errors != nil {
payload := e.Errors

if err := producer.Produce(rw, payload); err != nil {
if err := producer.Produce(rw, e); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
Expand Down

0 comments on commit 53c0759

Please sign in to comment.