From b9aaf8e51a074724347d3cfb69b351918bae4b98 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 11 Sep 2013 10:37:48 +0900 Subject: Fix #5: Move json parsing and error handling into the event factory Pass the raw string into the event factory and parse it to a json object there. If the string is not valid json, generate an error event. Add a unit test for handling of invalid json on the event stream. Change-Id: I209a89fd28c3a594b71443fc106e25d58c5cc1ea --- testdata/invalid-json.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 testdata/invalid-json.txt (limited to 'testdata') diff --git a/testdata/invalid-json.txt b/testdata/invalid-json.txt new file mode 100644 index 0000000..f7a60bb --- /dev/null +++ b/testdata/invalid-json.txt @@ -0,0 +1,4 @@ +)]}' +{"type":"user-defined-event", + "title":"Event title", + "description":"Event description"} -- cgit v1.2.1