Skip to content

Commit

Permalink
resolve issues with sending trace and store metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
WildBamaBoy committed Apr 12, 2024
1 parent 024621d commit cd3b30d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sdk/src/main/java/io/tebex/sdk/platform/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ default void sendTriageEvent(String errorMessage) {
StringWriter traceWriter = new StringWriter();
new Exception("stack trace for error message").printStackTrace(new PrintWriter(traceWriter));
HashMap<String, String> metadata = new HashMap<>();

TriageEvent.fromPlatform(this).withErrorMessage(errorMessage).send();
metadata.put("trace", traceWriter.toString());
TriageEvent.fromPlatform(this).withErrorMessage(errorMessage).withMetadata(metadata).send();
}

default void sendTriageEvent(Throwable exception) {
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/main/java/io/tebex/sdk/triage/TriageEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void send() {
.withBody(this.toJsonString(), "POST");

// Store name is set automatically by fromPlatform
if (this.storeName.equals("")) {
if (this.storeName != null && this.storeName.equals("")) {
_platform.debug("No store info while sending triage event, ignoring event");
return;
}
Expand Down

0 comments on commit cd3b30d

Please sign in to comment.