On Tuesday, December 6, 2011, Charlton Galvarino <[email protected]> wrote: > In OpenLayers/Format/JSON.js, it would be helpful to have another try/catch block. Sometimes my incoming JSON is bad, and as the code stands now, it throws a .js error and fails. > > Original: > > read: function(json, filter) { > var object; > if (this.nativeJSON) { > object = JSON.parse(json, filter); > } else try { > /** > * Parsing happens in three stages. In the first stage, we run the > > Suggested change: > > read: function(json, filter) { > var object; > if (this.nativeJSON) { > try { > object = JSON.parse(json, filter); > } > catch(e) { > // Fall through if the parse fails. > } > } else try { > /** > * Parsing happens in three stages. In the first stage, we run the
Hi. OpenLayers devs much better prefer pull requests than diffs in mails. Thx :-) -- Eric Lemoine Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel : 00 33 4 79 44 44 96 Mail : [email protected] http://www.camptocamp.com
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
