You've already forked golang-saas-starter-kit
mirror of
https://github.com/raseels-repos/golang-saas-starter-kit.git
synced 2025-07-17 01:42:36 +02:00
Add stacktrace to error response
This commit is contained in:
@ -10,6 +10,9 @@
|
|||||||
{{ if .Details }}
|
{{ if .Details }}
|
||||||
<p class="text-gray-500 mb-0">{{ .Details }}</p>
|
<p class="text-gray-500 mb-0">{{ .Details }}</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ if .StackTrace }}
|
||||||
|
<p class="text-gray-500 mb-0">{{ .StackTrace }}</p>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"html/template"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@ -200,7 +201,8 @@ func RenderError(ctx context.Context, w http.ResponseWriter, r *http.Request, er
|
|||||||
data := map[string]interface{}{
|
data := map[string]interface{}{
|
||||||
"StatusCode": resp.StatusCode,
|
"StatusCode": resp.StatusCode,
|
||||||
"Error": resp.Error,
|
"Error": resp.Error,
|
||||||
"Details": resp.Details,
|
"Details": template.HTML(resp.Details),
|
||||||
|
"StackTrace": template.HTML(resp.StackTrace),
|
||||||
"Fields": resp.Fields,
|
"Fields": resp.Fields,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user