diff --git a/src/main.rs b/src/main.rs index de2a1c8..1b9a2eb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -117,9 +117,10 @@ impl UpdateBot { o: 1, d: resp_message, }; - let response_json = - serde_json::to_string(&response).expect("Error parsing json response"); - cwtch.send_message(&profile.handle, convo_id, &response_json); + match serde_json::to_string(&response) { + OK(response_json) => cwtch.send_message(&profile.handle, convo_id, &response_json), + Err(e) => println!("Error parsing json response: {}", e.to_string()), + } } } }