Skip to content

Commit 956eaaf

Browse files
committed
fix(guard): proxy routing errors through ws (#3006)
1 parent c63f3f5 commit 956eaaf

File tree

6 files changed

+184
-92
lines changed

6 files changed

+184
-92
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

out/errors/guard.target_changed.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/guard/core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ futures-util.workspace = true
1717
futures.workspace = true
1818
http-body-util.workspace = true
1919
http-body.workspace = true
20+
http.workspace = true
2021
# TODO: Make this use workspace version
2122
hyper = { version = "1.6.0", features = ["full", "http1", "http2"] }
2223
hyper-tungstenite.workspace = true

packages/core/guard/core/src/errors.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ pub struct NoRouteTargets;
5656
"guard",
5757
"retry_attempts_exceeded",
5858
"Retry attempts exceeded.",
59-
"All {attempts} retry attempts failed (max: {max_attempts})."
59+
"All {attempts} retry attempts failed."
6060
)]
6161
pub struct RetryAttemptsExceeded {
6262
pub attempts: u32,
63-
pub max_attempts: u32,
6463
}
6564

6665
#[derive(RivetError, Serialize, Deserialize)]
@@ -74,7 +73,14 @@ pub struct ConnectionError {
7473
#[error(
7574
"guard",
7675
"websocket_service_unavailable",
77-
"WebSocket service unavailable.",
7876
"WebSocket service unavailable."
7977
)]
8078
pub struct WebSocketServiceUnavailable;
79+
80+
#[derive(RivetError, Serialize, Deserialize)]
81+
#[error(
82+
"guard",
83+
"target_changed",
84+
"WebSocket target changed, retry not possible."
85+
)]
86+
pub struct WebSocketTargetChanged;

0 commit comments

Comments
 (0)