Skip to content

fix: catch without argument does not suppress#177

Merged
jisotalo merged 1 commit intojisotalo:devfrom
crishoj:fix-catch-without-argument
Dec 27, 2025
Merged

fix: catch without argument does not suppress#177
jisotalo merged 1 commit intojisotalo:devfrom
crishoj:fix-catch-without-argument

Conversation

@crishoj
Copy link
Contributor

@crishoj crishoj commented Dec 9, 2025

Occasionally I see unhandled promise rejections during auto-reconnect:

Unhandled promise rejection: Promise { <rejected> } reason: 562 |                 this.activeSubscriptions = {};
563 |                 this.debug(`disconnectFromTarget(): Connection closing failed, connection was forced to close`);
564 |                 if (isReconnecting) {
565 |                     this.emit("disconnect", isReconnecting);
566 |                 }
567 |                 return reject(new client_error_1.default(`disconnect(): Disconnected with errors: ${disconnectError.message}`, err));
                                                       ^
ClientError: disconnect(): Disconnected with errors: unregisterAdsPort(): Timeout - no response in 2000 ms
    trace: [
  "disconnect(): Disconnected with errors: unregisterAdsPort(): Timeout - no response in 2000 ms",
  "unregisterAdsPort(): Timeout - no response in 2000 ms"
],
 adsError: {
  errorCode: undefined,
  errorStr: undefined,
},

Likely because .catch() without argument does not suppress exceptions.

@jisotalo
Copy link
Owner

Thanks @crishoj, I'll try to check this through during holidays!

@jisotalo jisotalo changed the base branch from master to dev December 27, 2025 06:24
@jisotalo jisotalo merged commit bf86002 into jisotalo:dev Dec 27, 2025
jisotalo added a commit that referenced this pull request Dec 27, 2025
### Added
- Added caching of built data types to improve performance
  - See [pull request #178](#178)

### Changed
- Bug fix: Unhandled Promise rejections during automatic reconnecting
  - See [pull request #177](#177)
- Fixed a Typescript warning at `socket.on("data", (data) => {...})` as the data chunk could be a string as well
- Dependencies updated
- Documentation updated
@jisotalo jisotalo mentioned this pull request Dec 27, 2025
jisotalo added a commit that referenced this pull request Dec 27, 2025
## [2.2.0] - 27.12.2025
### Added
- Added caching of built data types to improve performance
  - See [pull request #178](#178)
  
### Changed
- Bug fix: Unhandled Promise rejections during automatic reconnecting
  - See [pull request #177](#177)
- Fixed a Typescript warning at `socket.on("data", (data) => {...})` as the data chunk could be a string as well
- Dependencies updated
- Documentation updated

Thank you [Christian Rishøj](https://github.com/crishoj) for contribution!

All tests passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants