From a38d98034d7ab3d4ed70a8a38eba30f63e2038fe Mon Sep 17 00:00:00 2001 From: Lucas Teske Date: Mon, 11 Feb 2019 14:16:19 -0200 Subject: [PATCH] Added service fault handler --- server/server.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/server/server.go b/server/server.go index 61d8428..2d68791 100644 --- a/server/server.go +++ b/server/server.go @@ -21,6 +21,20 @@ func GenRemoteSignerServerMux(slog *SLog.Instance, sm etc.SMInterface, gpg etc.P ap := MakeAgentProxy(gpg, tm) agentAdmin := MakeAgentAdmin(tm, am) + if ge == nil || ie == nil || te == nil || kre == nil || sks == nil || tm == nil || am == nil || ap == nil || agentAdmin == nil { + slog.Error("One or more services has not been initialized.") + slog.Error(" GPG Endpoint: %p", ge) + slog.Error(" Internal Endpoint: %p", ie) + slog.Error(" Tests Endpoint: %p", te) + slog.Error(" KeyRing Endpoint: %p", kre) + slog.Error(" SKS Endpoint: %p", sks) + slog.Error(" Token Manager: %p", tm) + slog.Error(" Auth Manager: %p", am) + slog.Error(" Agent Proxy: %p", ap) + slog.Error(" Agent Admin: %p", agentAdmin) + slog.Fatal("Please check if the settings are correct.") + } + r := mux.NewRouter() // Add for / AddHKPEndpoints(r.PathPrefix("/pks").Subrouter())