@friggframework/core 2.0.0-next.77 → 2.0.0-next.78

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.
@@ -12,14 +12,14 @@ class FetchError extends BaseError {
12
12
  constructor(options = {}) {
13
13
  const { resource, init, response, responseBody } = options;
14
14
  const method = init?.method ?? 'GET';
15
- const initText = init
15
+ let initText = init
16
16
  ? init.body instanceof URLSearchParams
17
17
  ? (() => {
18
- init.body = init.body.toString();
19
- return JSON.stringify({ init }, null, 2);
20
- })()
18
+ init.body = init.body.toString();
19
+ return JSON.stringify({ init }, null, 2);
20
+ })()
21
21
  : JSON.stringify({ init }, null, 2)
22
- : '';
22
+ : '';
23
23
 
24
24
  let responseBodyText = '<response body is unavailable>';
25
25
  if (typeof responseBody === 'string') {
@@ -35,10 +35,17 @@ class FetchError extends BaseError {
35
35
  }
36
36
  }
37
37
 
38
- const responseHeaderText = response
38
+ let responseHeaderText = response
39
39
  ? JSON.stringify({ headers: responseHeaders }, null, 2)
40
40
  : '';
41
41
 
42
+ // sanitize error reporting
43
+ if (process.env.STAGE !== 'dev') {
44
+ initText = false;
45
+ responseHeaderText = false;
46
+ responseBodyText = false;
47
+ }
48
+
42
49
  const messageParts = [
43
50
  stripIndent`
44
51
  -----------------------------------------------------
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@friggframework/core",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "2.0.0-next.77",
4
+ "version": "2.0.0-next.78",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
7
7
  "@aws-sdk/client-kms": "^3.588.0",
@@ -38,9 +38,9 @@
38
38
  }
39
39
  },
40
40
  "devDependencies": {
41
- "@friggframework/eslint-config": "2.0.0-next.77",
42
- "@friggframework/prettier-config": "2.0.0-next.77",
43
- "@friggframework/test": "2.0.0-next.77",
41
+ "@friggframework/eslint-config": "2.0.0-next.78",
42
+ "@friggframework/prettier-config": "2.0.0-next.78",
43
+ "@friggframework/test": "2.0.0-next.78",
44
44
  "@prisma/client": "^6.17.0",
45
45
  "@types/lodash": "4.17.15",
46
46
  "@typescript-eslint/eslint-plugin": "^8.0.0",
@@ -80,5 +80,5 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "0f451bd5c8493b4ec6f82964a976cf2533aa94d8"
83
+ "gitHead": "c8e0c0c725a9e49b76d4e095927a443640bf9ec9"
84
84
  }