Ensure there is no infinite loop on error

This commit is contained in:
Franck Royer 2021-07-21 15:33:58 +10:00
parent 92a76b3be0
commit be007f4839
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- **Breaking**: Renamed `WakuRelay.(add|delete)PrivateDecryptionKey` to `WakuRelay.(add|delete)DecryptionKey` to make it clearer that it accepts both symmetric keys and asymmetric private keys. - **Breaking**: Renamed `WakuRelay.(add|delete)PrivateDecryptionKey` to `WakuRelay.(add|delete)DecryptionKey` to make it clearer that it accepts both symmetric keys and asymmetric private keys.
### Fix ### Fixed
- Align `WakuMessage` readme example with actual code behaviour. - Align `WakuMessage` readme example with actual code behaviour.
- Remove infinite loop when an error with Waku Store is encountered. - Remove infinite loop when an error with Waku Store is encountered.

View File

@ -168,15 +168,18 @@ export class WakuStore {
} }
} catch (err) { } catch (err) {
console.log('Failed to decode store reply', err); console.log('Failed to decode store reply', err);
return null;
} }
} catch (err) { } catch (err) {
console.log('Failed to send waku store query', err); console.log('Failed to send waku store query', err);
return null;
} }
} catch (err) { } catch (err) {
console.log( console.log(
'Failed to negotiate waku store protocol stream with peer', 'Failed to negotiate waku store protocol stream with peer',
err err
); );
return null;
} }
} }
} }