Skip to content

Commit 7f79329

Browse files
committed
fix: Check buffer is ready before promise in node
1 parent d62561c commit 7f79329

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 5.0.0-rc.1
4+
5+
- [node] fix: Check if buffer isReady before sending/creating Promise for request.
6+
37
## 5.0.0-rc.0
48

59
- Fix: Tag npm release with `next` to not make it latest

packages/node/src/transports/base.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ export abstract class BaseTransport implements Transport {
7373

7474
/** JSDoc */
7575
protected async _sendWithModule(httpModule: HTTPRequest, event: Event): Promise<Response> {
76+
if (!this._buffer.isReady()) {
77+
return Promise.reject(new SentryError('Not adding Promise due to buffer limit reached.'));
78+
}
7679
return this._buffer.add(
7780
new Promise<Response>((resolve, reject) => {
7881
const req = httpModule.request(this._getRequestOptions(), (res: http.IncomingMessage) => {

0 commit comments

Comments
 (0)