strong-error-handler 5.0.22 → 5.0.24
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.
|
@@ -20,26 +20,11 @@ jobs:
|
|
|
20
20
|
actions: read
|
|
21
21
|
|
|
22
22
|
steps:
|
|
23
|
-
- uses:
|
|
24
|
-
with:
|
|
25
|
-
disable-sudo: true
|
|
26
|
-
egress-policy: block
|
|
27
|
-
allowed-endpoints: >
|
|
28
|
-
api.github.com:443
|
|
29
|
-
github.com:443
|
|
30
|
-
objects.githubusercontent.com:443
|
|
31
|
-
|
|
32
|
-
- name: Checkout repository
|
|
33
|
-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
34
|
-
with:
|
|
35
|
-
persist-credentials: false
|
|
36
|
-
|
|
23
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
37
24
|
- name: Initialize CodeQL
|
|
38
|
-
uses: github/codeql-action/init@
|
|
25
|
+
uses: github/codeql-action/init@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v4.30.8
|
|
39
26
|
with:
|
|
40
|
-
languages: javascript
|
|
41
|
-
config-file:
|
|
42
|
-
|
|
27
|
+
languages: 'javascript'
|
|
28
|
+
config-file: ./.github/codeql/codeql-config.yml
|
|
43
29
|
- name: Perform CodeQL Analysis
|
|
44
|
-
uses: github/codeql-action/analyze@
|
|
45
|
-
|
|
30
|
+
uses: github/codeql-action/analyze@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v4.30.8
|
|
@@ -31,7 +31,7 @@ jobs:
|
|
|
31
31
|
fail-fast: false
|
|
32
32
|
runs-on: ${{ matrix.os }}
|
|
33
33
|
steps:
|
|
34
|
-
- uses: step-security/harden-runner@
|
|
34
|
+
- uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
|
35
35
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
36
36
|
with:
|
|
37
37
|
disable-sudo: true
|
|
@@ -41,11 +41,11 @@ jobs:
|
|
|
41
41
|
github.com:443
|
|
42
42
|
nodejs.org:443
|
|
43
43
|
registry.npmjs.org:443
|
|
44
|
-
- uses: actions/checkout@
|
|
44
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
45
45
|
with:
|
|
46
46
|
persist-credentials: false
|
|
47
47
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
48
|
-
uses: actions/setup-node@
|
|
48
|
+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
|
49
49
|
with:
|
|
50
50
|
node-version: ${{ matrix.node-version }}
|
|
51
51
|
cache: npm
|
|
@@ -59,7 +59,7 @@ jobs:
|
|
|
59
59
|
name: Code Lint
|
|
60
60
|
runs-on: ubuntu-latest
|
|
61
61
|
steps:
|
|
62
|
-
- uses: step-security/harden-runner@
|
|
62
|
+
- uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
|
63
63
|
with:
|
|
64
64
|
disable-sudo: true
|
|
65
65
|
egress-policy: block
|
|
@@ -68,11 +68,11 @@ jobs:
|
|
|
68
68
|
github.com:443
|
|
69
69
|
nodejs.org:443
|
|
70
70
|
registry.npmjs.org:443
|
|
71
|
-
- uses: actions/checkout@
|
|
71
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
72
72
|
with:
|
|
73
73
|
persist-credentials: false
|
|
74
74
|
- name: Use Node.js 20
|
|
75
|
-
uses: actions/setup-node@
|
|
75
|
+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
|
76
76
|
with:
|
|
77
77
|
node-version: 20
|
|
78
78
|
cache: 'npm'
|
|
@@ -89,19 +89,19 @@ jobs:
|
|
|
89
89
|
runs-on: ubuntu-latest
|
|
90
90
|
if: ${{ github.event.pull_request }}
|
|
91
91
|
steps:
|
|
92
|
-
- uses: step-security/harden-runner@
|
|
92
|
+
- uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
|
93
93
|
with:
|
|
94
94
|
disable-sudo: true
|
|
95
95
|
egress-policy: block
|
|
96
96
|
allowed-endpoints: >
|
|
97
97
|
github.com:443
|
|
98
98
|
registry.npmjs.org:443
|
|
99
|
-
- uses: actions/checkout@
|
|
99
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
100
100
|
with:
|
|
101
101
|
fetch-depth: 0
|
|
102
102
|
persist-credentials: false
|
|
103
103
|
- name: Use Node.js 20
|
|
104
|
-
uses: actions/setup-node@
|
|
104
|
+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
|
105
105
|
with:
|
|
106
106
|
node-version: 20
|
|
107
107
|
cache: npm
|
|
@@ -125,18 +125,18 @@ jobs:
|
|
|
125
125
|
name: Lockfile Lint
|
|
126
126
|
runs-on: ubuntu-latest
|
|
127
127
|
steps:
|
|
128
|
-
- uses: step-security/harden-runner@
|
|
128
|
+
- uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
|
129
129
|
with:
|
|
130
130
|
disable-sudo: true
|
|
131
131
|
egress-policy: block
|
|
132
132
|
allowed-endpoints: >
|
|
133
133
|
github.com:443
|
|
134
134
|
registry.npmjs.org:443
|
|
135
|
-
- uses: actions/checkout@
|
|
135
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
136
136
|
with:
|
|
137
137
|
persist-credentials: false
|
|
138
138
|
- name: Use Node.js 20
|
|
139
|
-
uses: actions/setup-node@
|
|
139
|
+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
|
140
140
|
with:
|
|
141
141
|
node-version: 20
|
|
142
142
|
cache: npm
|
|
@@ -32,7 +32,7 @@ jobs:
|
|
|
32
32
|
id-token: write
|
|
33
33
|
|
|
34
34
|
steps:
|
|
35
|
-
- uses: step-security/harden-runner@
|
|
35
|
+
- uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
|
36
36
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
37
37
|
with:
|
|
38
38
|
disable-sudo: true
|
|
@@ -47,11 +47,11 @@ jobs:
|
|
|
47
47
|
rekor.sigstore.dev:443
|
|
48
48
|
tuf-repo-cdn.sigstore.dev:443
|
|
49
49
|
www.bestpractices.dev:443
|
|
50
|
-
- uses: actions/checkout@
|
|
50
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
51
51
|
with:
|
|
52
52
|
persist-credentials: false
|
|
53
53
|
|
|
54
|
-
- uses: ossf/scorecard-action@
|
|
54
|
+
- uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
|
|
55
55
|
with:
|
|
56
56
|
results_file: results.sarif
|
|
57
57
|
results_format: sarif
|
|
@@ -73,6 +73,6 @@ jobs:
|
|
|
73
73
|
retention-days: 90
|
|
74
74
|
|
|
75
75
|
# Upload the results to GitHub's code scanning dashboard.
|
|
76
|
-
- uses: github/codeql-action/upload-sarif@
|
|
76
|
+
- uses: github/codeql-action/upload-sarif@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v4.30.8
|
|
77
77
|
with:
|
|
78
78
|
sarif_file: results.sarif
|
package/CHANGES.md
CHANGED
|
@@ -1,3 +1,81 @@
|
|
|
1
|
+
2025-10-14, Version 5.0.24
|
|
2
|
+
==========================
|
|
3
|
+
|
|
4
|
+
* chore: update actions/setup-node action to v6 (renovate[bot])
|
|
5
|
+
|
|
6
|
+
* chore: update github/codeql-action action to v4 (renovate[bot])
|
|
7
|
+
|
|
8
|
+
* chore: lock file maintenance (renovate[bot])
|
|
9
|
+
|
|
10
|
+
* chore: update github/codeql-action action to v3.30.8 (renovate[bot])
|
|
11
|
+
|
|
12
|
+
* chore: update github/codeql-action action to v3.30.7 (renovate[bot])
|
|
13
|
+
|
|
14
|
+
* chore: update dependency eslint to ^9.37.0 (renovate[bot])
|
|
15
|
+
|
|
16
|
+
* chore: update github/codeql-action action to v3.30.6 (renovate[bot])
|
|
17
|
+
|
|
18
|
+
* chore: update ossf/scorecard-action action to v2.4.3 (renovate[bot])
|
|
19
|
+
|
|
20
|
+
* chore: update dependency @commitlint/cli to ^20.1.0 (renovate[bot])
|
|
21
|
+
|
|
22
|
+
* chore: update commitlint monorepo to v20 (renovate[bot])
|
|
23
|
+
|
|
24
|
+
* chore: update dependency chai to ^6.2.0 (renovate[bot])
|
|
25
|
+
|
|
26
|
+
* chore: update github/codeql-action action to v3.30.5 (renovate[bot])
|
|
27
|
+
|
|
28
|
+
* chore: update github/codeql-action action to v3.30.4 (renovate[bot])
|
|
29
|
+
|
|
30
|
+
* chore: update dependency eslint to ^9.36.0 (renovate[bot])
|
|
31
|
+
|
|
32
|
+
* chore: update dependency debug to ^4.4.3 (renovate[bot])
|
|
33
|
+
|
|
34
|
+
* chore: update github/codeql-action action to v3.30.3 (renovate[bot])
|
|
35
|
+
|
|
36
|
+
* chore: update step-security/harden-runner action to v2.13.1 (renovate[bot])
|
|
37
|
+
|
|
38
|
+
* chore: update github/codeql-action action to v3.30.2 (renovate[bot])
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
2025-09-08, Version 5.0.23
|
|
42
|
+
==========================
|
|
43
|
+
|
|
44
|
+
* chore: lock file maintenance (renovate[bot])
|
|
45
|
+
|
|
46
|
+
* chore: update dependency eslint to ^9.35.0 (renovate[bot])
|
|
47
|
+
|
|
48
|
+
* chore: update github/codeql-action action to v3.30.1 (renovate[bot])
|
|
49
|
+
|
|
50
|
+
* chore: update actions/setup-node action to v5 (renovate[bot])
|
|
51
|
+
|
|
52
|
+
* chore: update github/codeql-action action to v3.30.0 (renovate[bot])
|
|
53
|
+
|
|
54
|
+
* chore: update dependency chai to v6 (renovate[bot])
|
|
55
|
+
|
|
56
|
+
* chore: update dependency eslint to ^9.34.0 (renovate[bot])
|
|
57
|
+
|
|
58
|
+
* chore: update dependency chai to ^5.3.3 (renovate[bot])
|
|
59
|
+
|
|
60
|
+
* chore: update dependency chai to ^5.3.2 (renovate[bot])
|
|
61
|
+
|
|
62
|
+
* chore: update github/codeql-action action to v3.29.11 (renovate[bot])
|
|
63
|
+
|
|
64
|
+
* chore: update actions/checkout action to v5 (renovate[bot])
|
|
65
|
+
|
|
66
|
+
* feat: honor "expose" property of http-errors (dhmlau)
|
|
67
|
+
|
|
68
|
+
* fix: fix codeql (dhmlau)
|
|
69
|
+
|
|
70
|
+
* chore: update actions/checkout action to v4.3.0 (renovate[bot])
|
|
71
|
+
|
|
72
|
+
* chore: update github/codeql-action action to v3.29.10 (renovate[bot])
|
|
73
|
+
|
|
74
|
+
* chore: update dependency chai to ^5.3.1 (renovate[bot])
|
|
75
|
+
|
|
76
|
+
* chore: update github/codeql-action action to v3.29.9 (renovate[bot])
|
|
77
|
+
|
|
78
|
+
|
|
1
79
|
2025-08-11, Version 5.0.22
|
|
2
80
|
==========================
|
|
3
81
|
|
package/lib/data-builder.js
CHANGED
|
@@ -35,9 +35,9 @@ function buildResponseData(err, options) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
if (data.statusCode >= 400 && data.statusCode <= 499) {
|
|
38
|
-
|
|
38
|
+
fillClientError(data, err);
|
|
39
39
|
} else {
|
|
40
|
-
|
|
40
|
+
fillServerError(data, err);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const safeFields = options.safeFields || [];
|
|
@@ -66,15 +66,20 @@ function fillDebugData(data, err) {
|
|
|
66
66
|
cloneAllProperties(data, err);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
function
|
|
69
|
+
function fillClientError(data, err) {
|
|
70
70
|
data.name = err.name;
|
|
71
71
|
data.message = err.message;
|
|
72
72
|
data.code = err.code;
|
|
73
73
|
data.details = err.details;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
function
|
|
77
|
-
|
|
76
|
+
function fillServerError(data, err) {
|
|
77
|
+
if (err.expose) {
|
|
78
|
+
data.name = httpStatus[data.statusCode] || 'Unknown Error';
|
|
79
|
+
data.message = err.message;
|
|
80
|
+
} else {
|
|
81
|
+
data.message = httpStatus[data.statusCode] || 'Unknown Error';
|
|
82
|
+
}
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
function fillSafeFields(data, err, safeFields) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "strong-error-handler",
|
|
3
3
|
"description": "Error handler for use in development and production environments.",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "5.0.
|
|
5
|
+
"version": "5.0.24",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=16"
|
|
8
8
|
},
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
"main": "lib/handler.js",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"lint": "eslint .",
|
|
16
|
+
"lint:fix": "eslint . --fix",
|
|
16
17
|
"test": "mocha",
|
|
17
18
|
"posttest": "npm run lint"
|
|
18
19
|
},
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"accepts": "^1.3.8",
|
|
21
|
-
"debug": "^4.4.
|
|
22
|
+
"debug": "^4.4.3",
|
|
22
23
|
"fast-safe-stringify": "^2.1.1",
|
|
23
24
|
"handlebars": "^4.7.8",
|
|
24
25
|
"http-status": "^1.8.1",
|
|
@@ -26,12 +27,12 @@
|
|
|
26
27
|
"strong-globalize": "^6.0.6"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
|
-
"@commitlint/cli": "^
|
|
30
|
-
"@commitlint/config-conventional": "^
|
|
30
|
+
"@commitlint/cli": "^20.1.0",
|
|
31
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
31
32
|
"@eslint/eslintrc": "^3.3.1",
|
|
32
33
|
"@types/express": "^5.0.3",
|
|
33
|
-
"chai": "^
|
|
34
|
-
"eslint": "^9.
|
|
34
|
+
"chai": "^6.2.0",
|
|
35
|
+
"eslint": "^9.37.0",
|
|
35
36
|
"eslint-config-loopback": "^13.1.0",
|
|
36
37
|
"eslint-plugin-mocha": "^10.5.0",
|
|
37
38
|
"express": "^5.1.0",
|