Skip to content

Commit 28304d5

Browse files
committed
fix(pb, tunnel, gateway): refactor error handling
1 parent cc75d7e commit 28304d5

File tree

14 files changed

+308
-393
lines changed

14 files changed

+308
-393
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.

packages/core/guard/core/src/proxy_service.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -944,10 +944,10 @@ impl ProxyService {
944944
if !err.is_connect() || attempts >= max_attempts {
945945
tracing::error!(?err, "Request error after {} attempts", attempts);
946946
return Err(errors::UpstreamError(
947-
"failed to connect to runner. Make sure your runners are healthy and the provided runner address is reachable by Rivet."
948-
.to_string(),
949-
)
950-
.build());
947+
"failed to connect to runner. Make sure your runners are healthy and the provided runner address is reachable by Rivet."
948+
.to_string(),
949+
)
950+
.build());
951951
} else {
952952
// Request connect error, might retry
953953
tracing::debug!(?err, "Request attempt {attempts} failed");
@@ -2327,7 +2327,7 @@ fn err_to_close_frame(err: anyhow::Error) -> CloseFrame {
23272327
.unwrap_or_else(|| RivetError::from(&INTERNAL_ERROR));
23282328

23292329
let code = match (rivet_err.group(), rivet_err.code()) {
2330-
("ws", "connection_closed") => CloseCode::Normal,
2330+
("ws", "connection_closed") | ("ws", "eviction") => CloseCode::Normal,
23312331
_ => CloseCode::Error,
23322332
};
23332333

packages/core/guard/server/src/routing/pegboard_gateway.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ pub async fn route_request(
150150

151151
// Return pegboard-gateway instance
152152
let gateway = pegboard_gateway::PegboardGateway::new(
153-
ctx.clone(),
154153
shared_state.pegboard_gateway.clone(),
155154
runner_id,
156155
actor_id,

packages/core/pegboard-gateway/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ http-body-util.workspace = true
1515
hyper = "1.6"
1616
hyper-tungstenite.workspace = true
1717
pegboard.workspace = true
18-
rivet-runner-protocol.workspace = true
1918
rand.workspace = true
2019
rivet-error.workspace = true
2120
rivet-guard-core.workspace = true
21+
rivet-runner-protocol.workspace = true
2222
rivet-util.workspace = true
23+
serde.workspace = true
2324
thiserror.workspace = true
2425
tokio-tungstenite.workspace = true
2526
tokio.workspace = true

0 commit comments

Comments
 (0)