CARVIEW |
Select Language
HTTP/2 200
date: Wed, 23 Jul 2025 10:47:56 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/socketio/socket.io.git
etag: W/"2cd482b852d7e8727ccbe09cac90b34b"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=X817wb6jpEHA%2FbU%2FTTxcsDrxfWOUSjnqEM4JJ2ViUdv5SrL95LlTBJD4s2SFGwA%2BLQ4c8uAnRNopiw3kCJcg7VLtOQiKlTTUzfdCMfW7VitLctehiEzXmf8B%2F9S9Te0mqVs9jXiDqGP7hS3sj%2FGkHgIViVjKA54NSxVZ4L5SD6%2BGXGgM8JjJ%2FnJOmPmP5tT5hjk3cNu%2FRKIiy%2BBWklFeXRook%2BIeE0JjulNCCV%2BXlBiYDkIbTUR5XOCTPBzHebZ4YYHZtTf57ilS9QXOCFnjmg%3D%3D--j768C90lz1O40tIv--jCOakNyBA406syBUCAJbzQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.599043413.1753267675; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 10:47:55 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 10:47:55 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 9082:167F3A:998F46:B970DE:6880BDDB
feat: emit an Error object upon middleware error · socketio/socket.io@54bf4a4 · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit 54bf4a4
committed
feat: emit an Error object upon middleware error
This commit restores the ability to send additional data in the
middleware functions, which was removed during the rewrite to
Typescript ([1]).
The only difference with the previous implementation is that the client
will now emit a "connect_error" (previously, "error") event with an
actual Error object, with both the message and an optional "data"
attribute.
```js
// server-side
io.use((socket, next) => {
const err = new Error("not authorized");
err.data = { content: "Please retry later" };
next(err);
});
// client-side
socket.on("connect_error", err => {
console.log(err.message); // not authorized
console.log(err.data.content); // Please retry later
});
```
[1]: a5581a91 parent aa7574f commit 54bf4a4Copy full SHA for 54bf4a4
File tree
Expand file treeCollapse file tree
4 files changed
+45
-10
lines changedFilter options
- lib
- test
Expand file treeCollapse file tree
4 files changed
+45
-10
lines changed+3-1Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
93 | 93 |
| |
94 | 94 |
| |
95 | 95 |
| |
96 |
| - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
97 | 99 |
| |
98 | 100 |
| |
99 | 101 |
| |
|
+2-2Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
593 | 593 |
| |
594 | 594 |
| |
595 | 595 |
| |
596 |
| - | |
| 596 | + | |
597 | 597 |
| |
598 | 598 |
| |
599 | 599 |
| |
|
+14-4Lines changed: 14 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 |
| |
12 | 16 |
| |
13 | 17 |
| |
| |||
18 | 22 |
| |
19 | 23 |
| |
20 | 24 |
| |
21 |
| - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
22 | 28 |
| |
23 | 29 |
| |
24 | 30 |
| |
| |||
60 | 66 |
| |
61 | 67 |
| |
62 | 68 |
| |
63 |
| - | |
| 69 | + | |
64 | 70 |
| |
65 | 71 |
| |
66 | 72 |
| |
| |||
73 | 79 |
| |
74 | 80 |
| |
75 | 81 |
| |
76 |
| - | |
| 82 | + | |
77 | 83 |
| |
78 | 84 |
| |
79 | 85 |
| |
| |||
129 | 135 |
| |
130 | 136 |
| |
131 | 137 |
| |
132 |
| - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
133 | 143 |
| |
134 | 144 |
| |
135 | 145 |
| |
|
+26-3Lines changed: 26 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
522 | 522 |
| |
523 | 523 |
| |
524 | 524 |
| |
525 |
| - | |
| 525 | + | |
526 | 526 |
| |
527 | 527 |
| |
528 | 528 |
| |
| |||
814 | 814 |
| |
815 | 815 |
| |
816 | 816 |
| |
817 |
| - | |
| 817 | + | |
818 | 818 |
| |
819 | 819 |
| |
820 | 820 |
| |
| |||
2185 | 2185 |
| |
2186 | 2186 |
| |
2187 | 2187 |
| |
2188 |
| - | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
2189 | 2212 |
| |
2190 | 2213 |
| |
2191 | 2214 |
| |
|
You can’t perform that action at this time.
0 commit comments