Skip to content

Commit c2972cd

Browse files
aermolaevAlexander Ermolaev
and
Alexander Ermolaev
authored
fix: it is better to return the error with c.Error (#61)
Co-authored-by: Alexander Ermolaev <[email protected]>
1 parent f33cf31 commit c2972cd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

swagger.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package echoSwagger
22

33
import (
44
"html/template"
5-
"net/http"
65
"path/filepath"
76
"regexp"
87
"sync"
@@ -109,7 +108,7 @@ func EchoWrapHandler(configFns ...func(c *Config)) echo.HandlerFunc {
109108
case "doc.json":
110109
doc, err := swag.ReadDoc()
111110
if err != nil {
112-
http.Error(c.Response().Writer, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
111+
c.Error(err)
113112

114113
return nil
115114
}

0 commit comments

Comments
 (0)