matryer / matryer/respond

don't panic after writing headers

Open
#2 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
86
Forks
10
PR merge metrics
No merged PRs in 30d

Description

If the encoding fails, respond panics (https://github.com/matryer/respond/blob/master/respond.go#L33). However, it has already written out headers (https://github.com/matryer/respond/blob/master/respond.go#L28), so it's not possible to recover and display an error page, using e.g. this: https://github.com/dimfeld/httptreemux#panic-handling

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading respond.go around lines 28 and 33, following how headers are written before encoding and how an encoding failure becomes a panic. Check the repository's existing tests and response flow; done means encoding failures no longer panic after headers have been written and the behavior supports the cited panic-handling use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.