Skip to content

Commit e0df770

Browse files
authored
Apply suggestion from @austinborn
1 parent bf7337c commit e0df770

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

src/api/client.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,6 @@ impl ActualApiClient {
105105
if status == reqwest::StatusCode::UNAUTHORIZED {
106106
return Err(ActualError::NotLoggedIn);
107107
}
108-
// A 403 from api-service means the session's org is not authorized for
109-
// the request (cross-org, fail-closed). Surface it as a distinct,
110-
// actionable error rather than an opaque API error.
111-
//
112-
// ASSUMPTION: every 403 the advisor endpoints emit today is a cross-org
113-
// denial — it is the only 403 producer in api-service — so we map on the
114-
// status alone and intentionally do NOT inspect the body. The server's
115-
// 403 body carries no stable per-cause discriminator to match on, and
116-
// routing a 403 through `map_error_response` (which expects a nested
117-
// `{error:{code,message}}`) would only re-bury the cross-org case as a
118-
// generic API error.
119-
//
120-
// TODO: if api-service ever grows a non-org 403 producer, this hook must
121-
// discriminate instead of assuming cross-org. That needs a server-provided
122-
// signal (e.g. a stable `error.code` on the 403 body): parse it here and
123-
// fall back to `map_error_response` for any non-org-mismatch code.
124108
if status == reqwest::StatusCode::FORBIDDEN {
125109
return Err(Self::forbidden_org_error());
126110
}

0 commit comments

Comments
 (0)