CityScope / CS_Cooper-Hewitt

meta repo/sandbox repo for keeping everything related to the Cooper Hewitt exhibition
5 stars 2 forks source link

try-catch and robust UDP-json parsing #100

Closed yasushisakai closed 5 years ago

yasushisakai commented 5 years ago

Compatible with Processing’s APIs around JSON Format. parseJSONObject, getJSONObject() and getJSONArray() returns null if there isn’t a object, or original string unparseable. Where getFloat(), getInt() returns an exception.

All mines are avoided with return, not a break, to simply ignore corrupted JSON inputs.