mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
Avoid reporting max payload size exceeded errors to Sentry in collaboration server (#12002)
Agent-Logs-Url: https://github.com/outline/outline/sessions/ec7f1b13-6d7e-49d7-a8a4-f1223ba07a93 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com>
This commit is contained in:
@@ -34,6 +34,10 @@ export default function init(
|
||||
|
||||
// Handle WebSocket server errors to prevent crashes when maxPayload is exceeded
|
||||
wss.on("error", (error) => {
|
||||
if (error?.message?.includes("Max payload size exceeded")) {
|
||||
Logger.warn("WebSocket server error", { message: error.message });
|
||||
return;
|
||||
}
|
||||
Logger.error("WebSocket server error", error);
|
||||
});
|
||||
|
||||
@@ -97,6 +101,13 @@ export default function init(
|
||||
wss.handleUpgrade(req, socket, head, (client) => {
|
||||
// Handle websocket connection errors as soon as the client is upgraded
|
||||
client.on("error", (error) => {
|
||||
if (error?.message?.includes("Max payload size exceeded")) {
|
||||
Logger.warn("Websocket error", {
|
||||
message: error.message,
|
||||
documentId,
|
||||
});
|
||||
return;
|
||||
}
|
||||
Logger.error(
|
||||
`Websocket error`,
|
||||
error,
|
||||
|
||||
Reference in New Issue
Block a user