We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 50d437b commit bc16798Copy full SHA for bc16798
server/src/operators/message_operator.rs
@@ -69,7 +69,15 @@ pub async fn create_message_query(
69
) -> Result<(), ServiceError> {
70
use crate::data::schema::messages::dsl::messages;
71
72
- let mut conn = pool.get().await.unwrap();
+ let mut conn = match pool.get().await {
73
+ Ok(conn) => conn,
74
+ Err(e) => {
75
+ log::error!("Error getting connection from pool: {:?}", e);
76
+ return Err(ServiceError::InternalServerError(
77
+ "Error getting postgres connection from pool".into(),
78
+ ));
79
+ }
80
+ };
81
82
diesel::insert_into(messages)
83
.values(&new_message)
0 commit comments