Skip to content

Commit c5bdc9f

Browse files
committed
Fix context key
1 parent 2421758 commit c5bdc9f

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎core/src/main/java/dev/faststats/ErrorHelper.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private static JsonObject compileAll(final TrackedError trackedError, @Nullable
5959

6060
final var attributes = new JsonObject();
6161
trackedError.attributes().forEachPrimitive(attributes::add);
62-
if (!attributes.isEmpty()) report.add("attributes", attributes);
62+
if (!attributes.isEmpty()) report.add("context", attributes);
6363

6464
return report;
6565
}

‎core/src/test/java/dev/faststats/ErrorTrackerTest.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,12 @@ public void trackedErrorSerializesProperties() {
329329
.put("retrying", true));
330330

331331
final var report = tracker.getData().get(0).getAsJsonObject();
332-
final var attributes = report.getAsJsonObject("attributes");
332+
final var context = report.getAsJsonObject("context");
333333

334334
assertTrue(report.get("handled").getAsBoolean());
335-
assertEquals("startup", attributes.get("stage").getAsString());
336-
assertEquals(2, attributes.get("attempt").getAsInt());
337-
assertTrue(attributes.get("retrying").getAsBoolean());
335+
assertEquals("startup", context.get("stage").getAsString());
336+
assertEquals(2, context.get("attempt").getAsInt());
337+
assertTrue(context.get("retrying").getAsBoolean());
338338
}
339339

340340
private RuntimeException createStableError() {

0 commit comments

Comments
 (0)