Add message for the '--as-gateway' option

This commit is contained in:
Kevin Yue 2024-04-06 19:26:42 +08:00
parent e9cb253be1
commit 879b977321

View File

@ -111,11 +111,16 @@ impl<'a> ConnectHandler<'a> {
info!("Failed to connect portal with prelogin: {}", err); info!("Failed to connect portal with prelogin: {}", err);
if err.root_cause().downcast_ref::<PortalError>().is_some() { if err.root_cause().downcast_ref::<PortalError>().is_some() {
info!("Trying the gateway authentication workflow..."); info!("Trying the gateway authentication workflow...");
return self.connect_gateway_with_prelogin(server).await; self.connect_gateway_with_prelogin(server).await?;
}
eprintln!("\nNOTE: the server may be a gateway, not a portal.");
eprintln!("NOTE: try to use the `--as-gateway` option if you were authenticated twice.");
Ok(())
} else {
Err(err) Err(err)
} }
}
async fn connect_portal_with_prelogin(&self, portal: &str) -> anyhow::Result<()> { async fn connect_portal_with_prelogin(&self, portal: &str) -> anyhow::Result<()> {
let gp_params = self.build_gp_params(); let gp_params = self.build_gp_params();