diff --git a/crates/gl/src/quickstart.rs b/crates/gl/src/quickstart.rs index 8b901ad9..1f67d339 100644 --- a/crates/gl/src/quickstart.rs +++ b/crates/gl/src/quickstart.rs @@ -108,11 +108,17 @@ pub async fn run(args: QuickstartArgs) -> Result<()> { "saved_at": chrono::Utc::now().to_rfc3339(), }); std::fs::write(&ucan_path, serde_json::to_string_pretty(&record)?)?; + let trust = payload["trust_score"].as_f64().unwrap_or(0.0); + println!(" ✓ Registered successfully"); + println!(" Trust score: {trust:.2}"); + println!(" UCAN saved to {}", ucan_path.display()); + } else { + // A 2xx without a usable ucan is not a registration; the + // response may not even be JSON. Saying success here would + // also leave a stale ucan.json from another node in place. + println!(" ✗ Registration returned no UCAN (unexpected response body)"); + println!(" You can retry with: gl register --node {}", args.node); } - let trust = payload["trust_score"].as_f64().unwrap_or(0.0); - println!(" ✓ Registered successfully"); - println!(" Trust score: {trust:.2}"); - println!(" UCAN saved to {}", ucan_path.display()); println!(); } Ok(resp) => {