FAQ
I took a look at a few big frameworks and I noticed that recovery middleware
only writes 500 instead of writing a error page.

For example gogs uses the macaron framework [1].
The macaron recovery handler only writes the header with a 500 status code [2].

Or gin [3]

Initially I thought that an error page would make more sense,
but with even gogs only writing a 500, I’m not so sure anymore.

[1] https://github.com/gogits/gogs/blob/master/cmd/web.go#L106
[2] https://github.com/go-macaron/macaron/blob/master/recovery.go#L154
[3] https://github.com/gin-gonic/gin/blob/develop/recovery.go#L42

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Caleb Spare at Mar 29, 2016 at 10:00 pm
    That can be useful in development, but exposing error information in
    production is a security risk.
    On Tue, Mar 29, 2016 at 2:57 PM, Anmol Sethi wrote:
    I took a look at a few big frameworks and I noticed that recovery middleware
    only writes 500 instead of writing a error page.

    For example gogs uses the macaron framework [1].
    The macaron recovery handler only writes the header with a 500 status code [2].

    Or gin [3]

    Initially I thought that an error page would make more sense,
    but with even gogs only writing a 500, I’m not so sure anymore.

    [1] https://github.com/gogits/gogs/blob/master/cmd/web.go#L106
    [2] https://github.com/go-macaron/macaron/blob/master/recovery.go#L154
    [3] https://github.com/gin-gonic/gin/blob/develop/recovery.go#L42

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Anmol Sethi at Mar 29, 2016 at 10:14 pm
    I meant a generic internal server error page. Some HTML. These handlers return nothing. They only write the 500 header.
    On Mar 29, 2016, at 6:00 PM, Caleb Spare wrote:

    That can be useful in development, but exposing error information in
    production is a security risk.
    On Tue, Mar 29, 2016 at 2:57 PM, Anmol Sethi wrote:
    I took a look at a few big frameworks and I noticed that recovery middleware
    only writes 500 instead of writing a error page.

    For example gogs uses the macaron framework [1].
    The macaron recovery handler only writes the header with a 500 status code [2].

    Or gin [3]

    Initially I thought that an error page would make more sense,
    but with even gogs only writing a 500, I’m not so sure anymore.

    [1] https://github.com/gogits/gogs/blob/master/cmd/web.go#L106
    [2] https://github.com/go-macaron/macaron/blob/master/recovery.go#L154
    [3] https://github.com/gin-gonic/gin/blob/develop/recovery.go#L42

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Wilk at Mar 30, 2016 at 11:04 am

    On 29-03-2016, Anmol Sethi wrote:
    I took a look at a few big frameworks and I noticed that recovery middleware
    only writes 500 instead of writing a error page.

    For example gogs uses the macaron framework [1].
    The macaron recovery handler only writes the header with a 500 status code [2].

    Or gin [3]

    Initially I thought that an error page would make more sense,
    I think like you. I write something like "An error occured, don't worry
    a sysadmin will take care..."

    --
    William

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 29, '16 at 9:57p
activeMar 30, '16 at 11:04a
posts4
users3
websitegolang.org

3 users in discussion

Anmol Sethi: 2 posts Wilk: 1 post Caleb Spare: 1 post

People

Translate

site design / logo © 2021 Grokbase