Add more http error values
- Add more http error values.
You can not rename existing public variables - this is not backwards compatible and would break others repos compiling
Ok, I rollback the "ErrStatusRequestEntityTooLarge"
I personally like the addition of the additional error codes. Adding the HTTP Status Code as a comment might help to visualize the sort order.
@siyual-park Could you add comments for the HTTP status codes too (for all errors) to make it obvious where to fit in further codes:
var (
ErrUnsupportedMediaType = NewHTTPError(http.StatusUnsupportedMediaType) // HTTP 415 Unsupported Media Type
ErrNotFound = NewHTTPError(http.StatusNotFound) // HTTP 404 Not Found
ErrUnauthorized = NewHTTPError(http.StatusUnauthorized) // HTTP 401 Unauthorized
ErrForbidden = NewHTTPError(http.StatusForbidden) // HTTP 403 Forbidden```
Thanks for the good suggestions. i add comments for the HTTP status codes.
Codecov Report
Base: 92.35% // Head: 92.80% // Increases project coverage by +0.45% :tada:
Coverage data is based on head (
128d6fc) compared to base (666938e). Patch has no changes to coverable lines.
Additional details and impacted files
@@ Coverage Diff @@
## master #2277 +/- ##
==========================================
+ Coverage 92.35% 92.80% +0.45%
==========================================
Files 37 38 +1
Lines 4436 4506 +70
==========================================
+ Hits 4097 4182 +85
+ Misses 247 236 -11
+ Partials 92 88 -4
| Impacted Files | Coverage Δ | |
|---|---|---|
| echo.go | 95.47% <ø> (+0.29%) |
:arrow_up: |
| middleware/logger.go | 85.10% <0.00%> (-1.47%) |
:arrow_down: |
| ip.go | 100.00% <0.00%> (ø) |
|
| middleware/jwt.go | 92.98% <0.00%> (ø) |
|
| middleware/compress.go | 81.15% <0.00%> (ø) |
|
| middleware/body_dump.go | 90.47% <0.00%> (ø) |
|
| middleware/rate_limiter.go | 100.00% <0.00%> (ø) |
|
| middleware/context_timeout.go | 100.00% <0.00%> (ø) |
|
| middleware/extractor.go | 99.13% <0.00%> (+0.01%) |
:arrow_up: |
| middleware/request_logger.go | 97.56% <0.00%> (+0.08%) |
:arrow_up: |
| ... and 6 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@siyual-park Thanks for your contribution!