mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-06-14 04:01:30 +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) {
|
private String serializePayload(Object payload) {
|
||||||
// JSONシリアライゼーション
|
try {
|
||||||
return objectMapper.writeValueAsString(payload);
|
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) {
|
private String serializePayload(Object payload) {
|
||||||
// JSON serileştirme
|
try {
|
||||||
return objectMapper.writeValueAsString(payload);
|
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) {
|
private String serializePayload(Object payload) {
|
||||||
// JSON序列化
|
try {
|
||||||
return objectMapper.writeValueAsString(payload);
|
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) {
|
private String serializePayload(Object payload) {
|
||||||
// JSON serialization
|
try {
|
||||||
return objectMapper.writeValueAsString(payload);
|
return objectMapper.writeValueAsString(payload);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new IllegalStateException("Failed to serialize event payload", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user