Skip to content

Commit 5f75ddd

Browse files
committed
address some comments from PR
1 parent 313cdc6 commit 5f75ddd

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/diagnostics/diagnostics.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ func (r *DiagnosticsRegistry) EnableServer(port int) {
4848
}()
4949
}
5050

51+
// Registers diagnostics source callback with a given name. Name will be used as a key and callback result as a value in JSON object
52+
// during composing diagnostics JSON. Note: function will override existing diagnostics source on attempt to register another one with the same name
5153
func (r *DiagnosticsRegistry) RegisterSource(name string, source func() string) {
5254
r.diagnosticsMutex.Lock()
5355
defer r.diagnosticsMutex.Unlock()
@@ -72,6 +74,7 @@ func (r *DiagnosticsRegistry) exposeDiagnostics() string {
7274

7375
bytes, err := json.Marshal(diagnostics)
7476
if err != nil {
77+
logger.Errorf("diagnostics JSON serialization error: [%v]", err)
7578
return ""
7679
}
7780

0 commit comments

Comments
 (0)