Make error a predefined variable for later comparision
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Start at decoder.go line 30, linked in the issue, and inspect how the decoding error is returned. Define a predefined error for the missing content type case so callers can compare the returned error and choose a custom response; done means that specific error is identifiable to application developers.
Written by the indexing model from the issue text.
Description
https://github.com/go-chi/render/blob/3215478343fbc559bd3fc08f7031bb134d6bdad5/decoder.go#L30
If the returned error are defined var, it would be possible to compare and know what exactly happened. The error message from render package cannot be directly to client in most cases, but application developer would like to return some custom error.
var (
ErrContentTypeNotSet = errors.New("render: missing content-type, unable to automatically decode the request content")
)
would be helpful.
- Dominant language
- Go
- Stars
- 341
- Forks
- 68
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from go-chi/render
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
Any concern render.JSON() can leak internal errors to outside?Possibly taken @team-humaki claimed this 48 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
rishikanthc/Scriberr#506 ·
-
[Bug] rollingUpdatePartition panics when live StatefulSet replicas sit far below the desired countOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sgl-project/rbg#547 ·
Maintainers usually reply within 1 day
-
area: frontend priority: normal
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area/validator
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
TestAutonomousStop_ReportsObservedState fails under host load: 1s wall-clock ceiling vs 250ms cycleOpentype:bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
nightgauge/nightgauge#2909 ·
Maintainers usually reply within 1 day