mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-28 08:02:43 +00:00
fix(hub_publish): return 400 not 500 when HUB_DEV_TOKEN is unset
Missing config is a client/config error, not a server fault. Restores the BadRequest class lost when hub_token() was extracted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
f8705ec56a
commit
ca5c8e9717
@@ -362,7 +362,12 @@ async fn submit_project(
|
||||
}
|
||||
|
||||
fn hub_token() -> Result<String, Error> {
|
||||
std::env::var("HUB_DEV_TOKEN").map_err(|_| Error::InternalErr("HUB_DEV_TOKEN not set".into()))
|
||||
// Missing config, not a server fault: surface a clear 400 rather than a 500.
|
||||
std::env::var("HUB_DEV_TOKEN").map_err(|_| {
|
||||
Error::BadRequest(
|
||||
"Hub publishing is not configured on this instance (HUB_DEV_TOKEN not set)".into(),
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
async fn get_from_hub(path: &str, source_id: &str) -> Result<(StatusCode, String), Error> {
|
||||
|
||||
Reference in New Issue
Block a user