Skip to content

Commit

Permalink
fix: add new line to panic stack trace so Error Reporting can ingest …
Browse files Browse the repository at this point in the history
…the log (#190)
  • Loading branch information
KaylaNguyen authored Apr 24, 2023
1 parent 33b6d94 commit 76466dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion funcframework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var errorType = reflect.TypeOf((*error)(nil)).Elem()
func recoverPanic(w http.ResponseWriter, panicSrc string) {
if r := recover(); r != nil {
genericMsg := fmt.Sprintf(panicMessageTmpl, panicSrc)
fmt.Fprintf(os.Stderr, "%s\npanic message: %v\nstack trace: %s", genericMsg, r, debug.Stack())
fmt.Fprintf(os.Stderr, "%s\npanic message: %v\nstack trace: \n%s", genericMsg, r, debug.Stack())
if w != nil {
writeHTTPErrorResponse(w, http.StatusInternalServerError, crashStatus, genericMsg)
}
Expand Down

0 comments on commit 76466dd

Please sign in to comment.