diff --git a/CHANGELOG.md b/CHANGELOG.md index 41b0705d..615c2921 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ Change Log --- +## [4.0.3](https://github.com/AndrewBarba/apns2/releases/tag/4.0.3) + +1. Listen for `error` event when connecting an http2 session + ## [4.0.2](https://github.com/AndrewBarba/apns2/releases/tag/4.0.2) 1. Reset signing token every 59 minutes to prevent `TooManyProviderTokenUpdates` error diff --git a/lib/http2-client.js b/lib/http2-client.js index 4b947674..6a27ae0a 100644 --- a/lib/http2-client.js +++ b/lib/http2-client.js @@ -50,6 +50,7 @@ class HTTP2Client { connect() { return new Promise((resolve, reject) => { let session = http2.connect(this._url) + session.once('error', reject) session.once('socketError', reject) session.once('connect', () => { this._connected(session) diff --git a/package.json b/package.json index f70dd359..1b17ed19 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "apns2", - "version": "4.0.2", + "version": "4.0.3", "description": "Node client for connecting to Apple's Push Notification Service using the new HTTP/2 protocol with JSON web tokens.", "author": "Andrew Barba ", "main": "lib/apns.js",