1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-07-15 01:34:32 +02:00

Add stacktrace to error response

This commit is contained in:
Lee Brown
2020-01-14 10:49:19 -08:00
parent 8aca18a353
commit 59554a22d5
2 changed files with 6 additions and 1 deletions

View File

@ -10,6 +10,9 @@
{{ if .Details }}
<p class="text-gray-500 mb-0">{{ .Details }}</p>
{{ end }}
{{ if .StackTrace }}
<p class="text-gray-500 mb-0">{{ .StackTrace }}</p>
{{ end }}
</div>
</div>
{{ end }}

View File

@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"html/template"
"net/http"
"os"
"path"
@ -200,7 +201,8 @@ func RenderError(ctx context.Context, w http.ResponseWriter, r *http.Request, er
data := map[string]interface{}{
"StatusCode": resp.StatusCode,
"Error": resp.Error,
"Details": resp.Details,
"Details": template.HTML(resp.Details),
"StackTrace": template.HTML(resp.StackTrace),
"Fields": resp.Fields,
}