mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-06-10 18:23:12 +08:00
fix: handle checked JsonProcessingException in serializePayload
writeValueAsString throws checked JsonProcessingException which was unhandled, causing a compile error. Wrapped in try/catch, rethrowing as IllegalStateException.
This commit is contained in:
@@ -185,8 +185,11 @@ public class EventService {
|
||||
}
|
||||
|
||||
private String serializePayload(Object payload) {
|
||||
// JSONシリアライゼーション
|
||||
return objectMapper.writeValueAsString(payload);
|
||||
try {
|
||||
return objectMapper.writeValueAsString(payload);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new IllegalStateException("Failed to serialize event payload", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -185,8 +185,11 @@ public class EventService {
|
||||
}
|
||||
|
||||
private String serializePayload(Object payload) {
|
||||
// JSON serileştirme
|
||||
return objectMapper.writeValueAsString(payload);
|
||||
try {
|
||||
return objectMapper.writeValueAsString(payload);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new IllegalStateException("Failed to serialize event payload", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -185,8 +185,11 @@ public class EventService {
|
||||
}
|
||||
|
||||
private String serializePayload(Object payload) {
|
||||
// JSON序列化
|
||||
return objectMapper.writeValueAsString(payload);
|
||||
try {
|
||||
return objectMapper.writeValueAsString(payload);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new IllegalStateException("Failed to serialize event payload", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -187,8 +187,11 @@ public class EventService {
|
||||
}
|
||||
|
||||
private String serializePayload(Object payload) {
|
||||
// JSON serialization
|
||||
return objectMapper.writeValueAsString(payload);
|
||||
try {
|
||||
return objectMapper.writeValueAsString(payload);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new IllegalStateException("Failed to serialize event payload", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user