Skip to content

Commit 8eaf4fe

Browse files
committed
Update close handler to avoid unhandled promise rejections
1 parent c275806 commit 8eaf4fe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/EventSource.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ public function close()
270270

271271
$request->then(function (ResponseInterface $response) {
272272
$response->getBody()->close();
273+
}, function () {
274+
// ignore to avoid reporting unhandled rejection
273275
});
274276
$request->cancel();
275277
}

0 commit comments

Comments
 (0)