From 1e1e90027801e74db13447245a59426c0efbe435 Mon Sep 17 00:00:00 2001 From: astaxie Date: Tue, 30 Aug 2016 21:00:27 +0800 Subject: [PATCH] fix #2126 --- error.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/error.go b/error.go index ce25d281..ab626247 100644 --- a/error.go +++ b/error.go @@ -93,7 +93,11 @@ func showErr(err interface{}, ctx *context.Context, stack string) { "BeegoVersion": VERSION, "GoVersion": runtime.Version(), } - ctx.ResponseWriter.WriteHeader(500) + if ctx.Output.Status != 0 { + ctx.ResponseWriter.WriteHeader(ctx.Output.Status) + } else { + ctx.ResponseWriter.WriteHeader(500) + } t.Execute(ctx.ResponseWriter, data) }