attlaz-client 1.4.26 → 1.4.27

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.
@@ -51,18 +51,18 @@ class LogEndpoint extends Endpoint_1.Endpoint {
51
51
  });
52
52
  });
53
53
  }
54
- save(log) {
55
- return new Promise((resolve, reject) => {
54
+ async save(log) {
55
+ try {
56
56
  let cmd = '/logstreams/' + Utils_1.Utils.base64encode(log.logStream.id) + '/logs';
57
- this.httpClient.request(cmd, log, 'POST').then((rawSavedLog) => {
58
- resolve(Log_1.Log.parse(rawSavedLog.getData()));
59
- }).catch((reason) => {
60
- if (this.httpClient.isDebugEnabled()) {
61
- console.error('Failed to save log: ', reason);
62
- }
63
- reject(reason);
64
- });
65
- });
57
+ const result = await this.request(cmd, log, 'POST');
58
+ return Log_1.Log.parse(result.getData());
59
+ }
60
+ catch (error) {
61
+ if (this.httpClient.isDebugEnabled()) {
62
+ console.error('Failed to save log: ', error);
63
+ }
64
+ throw error;
65
+ }
66
66
  }
67
67
  async delete(logId) {
68
68
  let cmd = '/logstreams/:streamId/logs/' + logId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.4.26",
3
+ "version": "1.4.27",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",