oortcloud / node-ddp-client

A callback style DDP (Meteor's Distributed Data Protocol) node client.
Other
263 stars 80 forks source link

Added try/catch for uncaught JSON parse error. #73

Closed cfnelson closed 8 years ago

cfnelson commented 8 years ago

When Meteor.js is in development mode and your Meteor app crashes whilst your ddp-client is connected, the ddp-client will crash as well from an uncaught JSON parsing error.

This crash only occurs when you are using sockJs: true, autoReconnect: true or if you manually attempt to reconnect to the crashed website.

The parsing error occurs due to Meteor sending a ddp message containing html to inform the client that their app is crashing e.g - "Your app is crashing. Here's the latest log.".

I have kept the changes to a minimum, in order to not effect the code's structure.

Let me know if you have any questions. @vsivsi

RazZziel commented 8 years ago

+1

vsivsi commented 8 years ago

This looks good, I'll get it into 0.12.0