Merge pull request #4797 from flycash/fix4782
fxi4782: must set status before rendering error page
This commit is contained in:
commit
99d26b06b4
@ -68,6 +68,8 @@
|
||||
- Fix 4674: Tx Orm missing debug log [4756](https://github.com/beego/beego/pull/4756)
|
||||
- Fix 4759: fix numeric notation of permissions [4759](https://github.com/beego/beego/pull/4759)
|
||||
- set default rate and capacity for ratelimit filter [4796](https://github.com/beego/beego/pull/4796)
|
||||
- Fix 4782: must set status before rendering error page [4797](https://github.com/beego/beego/pull/4797)
|
||||
|
||||
## Fix Sonar
|
||||
|
||||
- [4677](https://github.com/beego/beego/pull/4677)
|
||||
|
||||
@ -507,14 +507,16 @@ func defaultRecoverPanic(ctx *context.Context, cfg *Config) {
|
||||
logs.Critical(fmt.Sprintf("%s:%d", file, line))
|
||||
stack = stack + fmt.Sprintln(fmt.Sprintf("%s:%d", file, line))
|
||||
}
|
||||
if cfg.RunMode == DEV && cfg.EnableErrorsRender {
|
||||
showErr(err, ctx, stack)
|
||||
}
|
||||
|
||||
if ctx.Output.Status != 0 {
|
||||
ctx.ResponseWriter.WriteHeader(ctx.Output.Status)
|
||||
} else {
|
||||
ctx.ResponseWriter.WriteHeader(500)
|
||||
}
|
||||
|
||||
if cfg.RunMode == DEV && cfg.EnableErrorsRender {
|
||||
showErr(err, ctx, stack)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user