Skip to main content
diff options
authorKevin Sawicki2012-06-05 15:52:16 +0000
committerKevin Sawicki2012-06-06 17:03:26 +0000
commit2056b1f217eebf7c862c0995a5026ccb491de9a4 (patch)
parent3dbb4dd7e04e56da8fb8f46e0b1047a7225623c5 (diff)
Suppress parse exceptions deserializing event payloads
Older events may include payloads with different field names or value types and parse exceptions that occur currently cause the entire list parsing to fail. By catching the parse exception on payload deserialization the event can still be returned with core fields but just a missing payload. This will allow returned pages with a mix of legacy and new event payloads to return successfully with proper payloads for new events and null payloads for legacy events. Change-Id: Iac866dd2d7a68ebbcb4ea7bec0c567a37e560ba0
1 files changed, 9 insertions, 3 deletions
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/
index 8cbfb9ab..cc53bcad 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/
@@ -123,8 +123,14 @@ public class EventFormatter implements JsonDeserializer<Event> {
return event;
- EventPayload typedPayload = context.deserialize(rawPayload,
- payloadClass);
- return event.setPayload(typedPayload);
+ try {
+ EventPayload typedPayload = context.deserialize(rawPayload,
+ payloadClass);
+ return event.setPayload(typedPayload);
+ } catch (JsonParseException jpe) {
+ // Parse exception here denotes legacy payloads with differing
+ // fields than built-in payload classes provide
+ return event;
+ }

Back to the top