dominicusmento / CSharpTradFriLibrary

This is a .NET Standard (2.0) library to communicate with the IKEA Home (Tradfri) ZigBee-based Gateway.
GNU General Public License v3.0
37 stars 20 forks source link

[BUG] - GenerateAppSecret timeout #36

Closed JKorf closed 4 years ago

JKorf commented 4 years ago

Thanks for your work! I think I've encountered a bug:

Describe the bug Calling GenerateAppSecret when the hub is not available takes 145 seconds to complete, after which it throws a nullreference exception.

To Reproduce Steps to reproduce the behavior:

  1. call GenerateAppSecret when the hub is not online.
  2. wait

Expected behavior Throw some sort of descriptive error. Also the timeout should be configurable.

dominicusmento commented 4 years ago

Hi,

I've reduced timeout to 10s and added a custom exception for timeout. For now I don't have time to implement configurable timeouts and exception for every call. Feel free to contribute if you have time. From current perspective I would call that a feature, not a bug so I consider this one as solved.