Repository navigation
Commit 6d2a312
fix(intercept): Improve error message when
In Node, it’s valid to invoke `new ClientMessage()` with no options. However, in Nock, this causes a crash:
Cannot read property 'proto' of undefined
stack: |
Object.normalizeRequestOptions (lib/common.js:12:27)
interceptorsFor (lib/intercept.js:139:10)
new OverriddenClientRequest (lib/intercept.js:263:26)
Test.t (tests/test_request_overrider.js:20:8)
Fixing that does not seem like a high priority, so this provides a better error message, while also removing related unreachable code.new ClientMessage() is invoked with no options (#1386)1 parent 8455e90 commit 6d2a312
2 files changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
259 | 269 | | |
260 | 270 | | |
261 | 271 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
0 commit comments