fix: graceful error on inbox parse failure instead of panic

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 22:49:54 +02:00
parent dd536c0949
commit 87b6e264c6
2 changed files with 3 additions and 1 deletions

View File

@@ -84,7 +84,7 @@ impl ColonyClient {
.get(self.url(&format!("/api/inbox?{}", self.config.user_query()))) .get(self.url(&format!("/api/inbox?{}", self.config.user_query())))
.send().await.unwrap_or_else(|e| { eprintln!("colony unreachable: {e}"); process::exit(1); }); .send().await.unwrap_or_else(|e| { eprintln!("colony unreachable: {e}"); process::exit(1); });
if !res.status().is_success() { self.handle_error(res).await; } if !res.status().is_success() { self.handle_error(res).await; }
res.json().await.unwrap() res.json().await.unwrap_or_else(|e| { eprintln!("failed to parse inbox response: {e}"); process::exit(1); })
} }
pub async fn ack_inbox(&self, ids: &[i64]) -> serde_json::Value { pub async fn ack_inbox(&self, ids: &[i64]) -> serde_json::Value {

2
ui/colony/.colony.toml Normal file
View File

@@ -0,0 +1,2 @@
api_url = "https://apes.unslope.com"
user = "neeraj"