@faasjs/http 0.0.2-beta.391 → 0.0.2-beta.394

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.
package/dist/index.js CHANGED
@@ -451,26 +451,16 @@ var Http = class {
451
451
  this.logger.debug("[onInvoke] Cookie: %j", this.cookie.content);
452
452
  this.logger.debug("[onInvoke] Session: %j", this.session.content);
453
453
  }
454
- if (this.validator) {
455
- this.logger.debug("[onInvoke] Valid request");
456
- try {
454
+ try {
455
+ if (this.validator) {
456
+ this.logger.debug("[onInvoke] Valid request");
457
457
  await this.validator.valid({
458
458
  headers: this.headers,
459
459
  params: this.params,
460
460
  cookie: this.cookie,
461
461
  session: this.session
462
462
  });
463
- } catch (error) {
464
- this.logger.error(error);
465
- data.response = {
466
- statusCode: error.statusCode || 500,
467
- headers: { "Content-Type": "application/json; charset=utf-8" },
468
- body: JSON.stringify({ error: { message: error.message } })
469
- };
470
- return;
471
463
  }
472
- }
473
- try {
474
464
  await next();
475
465
  } catch (error) {
476
466
  data.response = error;
package/dist/index.mjs CHANGED
@@ -444,26 +444,16 @@ var Http = class {
444
444
  this.logger.debug("[onInvoke] Cookie: %j", this.cookie.content);
445
445
  this.logger.debug("[onInvoke] Session: %j", this.session.content);
446
446
  }
447
- if (this.validator) {
448
- this.logger.debug("[onInvoke] Valid request");
449
- try {
447
+ try {
448
+ if (this.validator) {
449
+ this.logger.debug("[onInvoke] Valid request");
450
450
  await this.validator.valid({
451
451
  headers: this.headers,
452
452
  params: this.params,
453
453
  cookie: this.cookie,
454
454
  session: this.session
455
455
  });
456
- } catch (error) {
457
- this.logger.error(error);
458
- data.response = {
459
- statusCode: error.statusCode || 500,
460
- headers: { "Content-Type": "application/json; charset=utf-8" },
461
- body: JSON.stringify({ error: { message: error.message } })
462
- };
463
- return;
464
456
  }
465
- }
466
- try {
467
457
  await next();
468
458
  } catch (error) {
469
459
  data.response = error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/http",
3
- "version": "0.0.2-beta.391",
3
+ "version": "0.0.2-beta.394",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,8 +22,8 @@
22
22
  "dist"
23
23
  ],
24
24
  "peerDependencies": {
25
- "@faasjs/func": "^0.0.2-beta.391",
26
- "@faasjs/logger": "^0.0.2-beta.391"
25
+ "@faasjs/func": "^0.0.2-beta.394",
26
+ "@faasjs/logger": "^0.0.2-beta.394"
27
27
  },
28
28
  "devDependencies": {
29
29
  "tsup": "*",