NewLife/Stardust

Add error logging for all JSON marshal operations to improve debugging

Co-authored-by: nnhy <506367+nnhy@users.noreply.github.com>
copilot-swe-agent[bot] authored at 2026-02-13 05:38:58
d4c5619
Tree
1 Parent(s) aa6dc5f
Summary: 2 changed files with 4 additions and 0 deletions.
Modified +2 -0
Modified +2 -0
Modified +2 -0
diff --git a/SDK/Go/stardust/config.go b/SDK/Go/stardust/config.go
index fcc1487..01e4e77 100644
--- a/SDK/Go/stardust/config.go
+++ b/SDK/Go/stardust/config.go
@@ -100,6 +100,7 @@ func (c *ConfigClient) login() {
 
 	body, err := json.Marshal(payload)
 	if err != nil {
+		fmt.Fprintf(os.Stderr, "[Stardust] Config login marshal failed: %v\n", err)
 		return
 	}
 
@@ -136,6 +137,7 @@ func (c *ConfigClient) getAllConfig() {
 
 	body, err := json.Marshal(payload)
 	if err != nil {
+		fmt.Fprintf(os.Stderr, "[Stardust] Config marshal failed: %v\n", err)
 		return
 	}
 
Modified +2 -0
diff --git a/SDK/Go/stardust/tracer.go b/SDK/Go/stardust/tracer.go
index a88da59..f479c73 100644
--- a/SDK/Go/stardust/tracer.go
+++ b/SDK/Go/stardust/tracer.go
@@ -258,6 +258,7 @@ func (t *Tracer) login() {
 
 	body, err := json.Marshal(payload)
 	if err != nil {
+		fmt.Fprintf(os.Stderr, "[Stardust] Login marshal failed: %v\n", err)
 		return
 	}
 
@@ -336,6 +337,7 @@ func (t *Tracer) report(buildersData []*SpanBuilder) {
 
 	body, err := json.Marshal(model)
 	if err != nil {
+		fmt.Fprintf(os.Stderr, "[Stardust] Report marshal failed: %v\n", err)
 		return
 	}