bkper 2.6.0 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -98,8 +98,9 @@ class HttpApiRequest {
98
98
  });
99
99
  }
100
100
  catch (e) {
101
- if (HttpApiRequest.config.requestErrorHandler) {
102
- throw HttpApiRequest.config.requestErrorHandler(e);
101
+ const customError = HttpApiRequest.config.requestErrorHandler ? HttpApiRequest.config.requestErrorHandler(e) : undefined;
102
+ if (customError) {
103
+ throw customError;
103
104
  }
104
105
  else {
105
106
  //Default error handler
@@ -147,8 +148,10 @@ function getAccessToken() {
147
148
  if (local_auth_service_1.isLoggedIn() && token == null) {
148
149
  token = yield local_auth_service_1.getOAuthToken();
149
150
  }
150
- token = token.replace('Bearer ', '');
151
- token = token.replace('bearer ', '');
151
+ if (token) {
152
+ token = token.replace('Bearer ', '');
153
+ token = token.replace('bearer ', '');
154
+ }
152
155
  return token;
153
156
  });
154
157
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "description": "Node.js client for Bkper REST API",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",