Skip to content

Commit 2c3e099

Browse files
committed
MINOR: log: add stacktrace for panics on startup
1 parent 2137267 commit 2c3e099

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

configure_data_plane.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"os"
2626
"os/signal"
2727
"path/filepath"
28+
"runtime/debug"
2829
"strings"
2930
"syscall"
3031

@@ -107,7 +108,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler {
107108

108109
defer func() {
109110
if err := recover(); err != nil {
110-
log.Fatalf("Error starting Data Plane API: %s", err)
111+
log.Fatalf("Error starting Data Plane API: %s\n Stacktrace from panic: \n%s", err, string(debug.Stack()))
111112
}
112113
}()
113114
// configure the api here
@@ -144,7 +145,6 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler {
144145
api.BasicAuthAuth = func(user string, pass string) (interface{}, error) {
145146
return authenticateUser(user, pass, client)
146147
}
147-
148148
// setup discovery handlers
149149
api.DiscoveryGetAPIEndpointsHandler = discovery.GetAPIEndpointsHandlerFunc(func(params discovery.GetAPIEndpointsParams, principal interface{}) middleware.Responder {
150150
uriSlice := strings.SplitN(params.HTTPRequest.RequestURI[1:], "/", 2)

0 commit comments

Comments
 (0)