feedhenry / fh-sync

Node.js implementation of the FeedHenry Data Synchronisation Server. To be used in conjunction with the FeedHenry Data Synchronisation Client.
http://feedhenry.org
Apache License 2.0
5 stars 17 forks source link

Return error on getStats if Redis client is undefined #33

Closed aidenkeating closed 6 years ago

aidenkeating commented 6 years ago

Currently when calling getStats, if the first sync call has not been made yet, an error will be thrown stating it cannot get lrange of undefined.

This is a messy error and doesn't explain what is actually going on.

This adds an error message explaining that the client is not initialised and that an initial sync is required.

aidenkeating commented 6 years ago

@david-martin @wtrocki Would you mind taking a look?

Edit: The changes here are mostly indentation. These are the actual lines: L151, L174-177

wtrocki commented 6 years ago

@aidenkeating - Awesome contribution. This change may also partially resolve this issue: https://github.com/feedhenry/fh-sync/issues/25

Can you provide verification steps to avoid misunderstandings?

aidenkeating commented 6 years ago

@wtrocki Verification can be done using this PR. https://github.com/feedhenry/fh-sync-server/pull/5

wtrocki commented 6 years ago

Verified!

aidenkeating commented 6 years ago

Thanks for review/verification, addressed comments, merging

aidenkeating commented 6 years ago

Published as fh-sync@1.0.10 (https://www.npmjs.com/package/fh-sync)