Skip to content

Commit

Permalink
Do not error when region is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
yuezk committed Feb 1, 2024
1 parent 8860efa commit 0a55506
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/gpapi/src/portal/prelogin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ fn parse_res_xml(res_xml: String, is_gateway: bool) -> anyhow::Result<Prelogin>
bail!("Prelogin failed: {}", msg)
}

let region = xml::get_child_text(&doc, "region")
.ok_or_else(|| anyhow::anyhow!("Prelogin response does not contain region element"))?;
let region = xml::get_child_text(&doc, "region").unwrap_or_else(|| {
info!("Prelogin response does not contain region element");
String::from("Unknown")
});

let saml_method = xml::get_child_text(&doc, "saml-auth-method");
let saml_request = xml::get_child_text(&doc, "saml-request");
Expand Down

0 comments on commit 0a55506

Please sign in to comment.