gcf-common-lib 0.5.3 → 0.5.4

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.
Files changed (3) hide show
  1. package/index.js +7 -5
  2. package/index.ts +2 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -73,14 +73,16 @@ var GcfCommon = /** @class */ (function () {
73
73
  });
74
74
  }); })
75
75
  .catch(function (err) { return __awaiter(_this, void 0, void 0, function () {
76
- var dataJSON;
77
- return __generator(this, function (_a) {
78
- switch (_a.label) {
76
+ var fname, dataJSON;
77
+ var _a, _b;
78
+ return __generator(this, function (_c) {
79
+ switch (_c.label) {
79
80
  case 0:
80
- dataJSON = { error: { name: err.name, message: err.message, stack: err.stack } };
81
+ fname = (_b = (_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.K_SERVICE) !== null && _b !== void 0 ? _b : 'UNKNOWN';
82
+ dataJSON = { error: { name: err.name, message: "GCF [" + fname + "]: " + err.message, stack: err.stack } };
81
83
  return [4 /*yield*/, this.publish(event, context, dataJSON).catch(lodash_1.noop)];
82
84
  case 1:
83
- _a.sent();
85
+ _c.sent();
84
86
  throw err;
85
87
  }
86
88
  });
package/index.ts CHANGED
@@ -21,7 +21,8 @@ export class GcfCommon {
21
21
  await this.publish(event, context, res ?? {});
22
22
  })
23
23
  .catch(async (err: Error) => {
24
- const dataJSON = {error: {name: err.name, message: err.message, stack: err.stack}};
24
+ const fname = process?.env?.K_SERVICE ?? 'UNKNOWN';
25
+ const dataJSON = {error: {name: err.name, message: `GCF [${fname}]: ${err.message}`, stack: err.stack}};
25
26
  await this.publish(event, context, dataJSON).catch(noop);
26
27
  throw err;
27
28
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gcf-common-lib",
3
3
  "description": "",
4
- "version": "0.5.3",
4
+ "version": "0.5.4",
5
5
  "publishConfig": { "access": "public", "branches": ["master"] },
6
6
  "engines": {},
7
7
  "scripts": {