Commit 8e5c84f
committed
feat: do not emit "error" events anymore
Previously, the "error" events from the two Redis clients were
forwarded by each instance of the adapter, which made it quite hard to
handle the errors with a lot of namespaces (as there is one instance of
adapter per namespace).
```js
io.of("/my-namespace").adapter.on("error", () => {
// ...
});
```
The adapter instance will no longer emit "error" events, and will print
a warning if there is no other error handler registered (for backward
compatibility).
The error handling must be done directly on the Redis client:
```js
redisClient.on("error", (err) => {
// something went wrong, maybe the connection to the server was lost
});
```
Related:
- #412
- #4251 parent f66de11 commit 8e5c84f
1 file changed
+18
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | 117 | | |
124 | 118 | | |
125 | 119 | | |
| |||
136 | 130 | | |
137 | 131 | | |
138 | 132 | | |
139 | | - | |
| 133 | + | |
140 | 134 | | |
141 | 135 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
146 | 141 | | |
147 | 142 | | |
148 | 143 | | |
149 | | - | |
150 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
| |||
211 | 214 | | |
212 | 215 | | |
213 | 216 | | |
214 | | - | |
| 217 | + | |
215 | 218 | | |
216 | 219 | | |
217 | 220 | | |
| |||
406 | 409 | | |
407 | 410 | | |
408 | 411 | | |
409 | | - | |
| 412 | + | |
410 | 413 | | |
411 | 414 | | |
412 | 415 | | |
| |||
0 commit comments