diff --git a/src/synchronizations/member/synchronizer.rs b/src/synchronizations/member/synchronizer.rs index 4694ab5..92f703a 100644 --- a/src/synchronizations/member/synchronizer.rs +++ b/src/synchronizations/member/synchronizer.rs @@ -90,19 +90,31 @@ impl Synchronizer { }), }; - let ss_get_member_by_username_res_msg = self + let ss_get_member_by_username_res_msg = match self .connection_broker .request( bpr::ss::member::SUBJECT_GET_MEMBER_BY_USERNAME, ss_get_member_by_username_req.encode_to_vec(), ) .await - .expect("SUBJECT_GET_MEMBER_BY_USERNAME"); + { + Ok(r) => r, + Err(e) => { + println!("bpr::ss::member::SUBJECT_GET_MEMBER_BY_USERNAME: {}", e); + continue; + } + }; - let ss_get_member_by_username_res = bpr::ss::member::GetMemberByUsernameResponse::decode( - ss_get_member_by_username_res_msg.data.as_slice(), - ) - .expect("GetMemberByUsernameResponse"); + let ss_get_member_by_username_res = + match bpr::ss::member::GetMemberByUsernameResponse::decode( + ss_get_member_by_username_res_msg.data.as_slice(), + ) { + Ok(r) => r, + Err(e) => { + println!("bpr::ss::member::GetMemberByUsernameResponse: {}", e); + continue; + } + }; if let Some(e) = ss_get_member_by_username_res.error { println!( @@ -117,16 +129,19 @@ impl Synchronizer { Some(m) => { let member_id = uuid::Uuid::from_str(m.id.as_str()).expect("uuid::Uuid"); - self - .member_repository - .insert( - &conn, - &repositories::member::models::NewMember { - id: u.id, - member_id, - }, - ) - .expect("member insert"); + match self.member_repository.insert( + &conn, + &repositories::member::models::NewMember { + id: u.id, + member_id, + }, + ) { + Ok(r) => r, + Err(e) => { + println!("member_repository.insert: {}", e); + continue; + } + }; } None => { println!("member is not exist: {}", u.site_username);