gin
gin copied to clipboard
Only push net error to c.Errors and panic others errors
In pr: https://github.com/gin-gonic/gin/pull/2150, remove the panic in Render function and push all error to c.Errors.
This is to avoid panic when encountering "broken pipe -> write tcp" errors, in order to improve program performance.
However, this will also cause the program to ignore errors from json.Marshal(). When an error occurs during json.Marshal(), the client will only receive an empty http body.
Therefore, when it is a non-network error, Render() still needs to panic in order for the client to be aware of this error.