MariusRumpf / node-lifx

Node.js implementation of the LIFX LAN protocol :bulb:
MIT License
144 stars 28 forks source link

Add try catch for reading incoming packets #29

Closed RobinBol closed 8 years ago

RobinBol commented 8 years ago

It seems there is quite often a packet coming in that could not be read, it gave RangeError’s when trying to read it. By catching it we at least prevent the code from crashing when such a packet comes in. Further examination is needed to figure out what is “wrong” with these incoming packets.

codecov-io commented 8 years ago

Current coverage is 57.09%

Merging #29 into master will decrease coverage by 42.91%

  1. 35 files (not in diff) in lib/lifx/packets were modified. more
    • Misses +454
    • Hits -807
  2. 3 files (not in diff) in lib/lifx were modified. more
    • Misses +34
    • Hits -220
  3. 2 files in lib/lifx were modified. more
    • Misses +32
    • Hits -371
@@            master        #29   diff @@
=========================================
  Files           42         42           
  Lines         2135       1249    -886   
  Methods        103        103           
  Messages         0          0           
  Branches       193        194      +1   
=========================================
- Hits          2135        713   -1422   
- Misses           0        536    +536   
  Partials         0          0           

Powered by Codecov. Last updated by 106a9c6...1708d23