From d08ae63f50a4da49b56d90ebdfade08ac735c5cc Mon Sep 17 00:00:00 2001 From: shockrah Date: Thu, 17 Sep 2020 19:35:22 -0700 Subject: [PATCH] new macro to make error reporting a bit clearer --- server-api/db/src/common.rs | 7 ++++++- server-api/db/src/lib.rs | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server-api/db/src/common.rs b/server-api/db/src/common.rs index dc6a620..1d319f7 100644 --- a/server-api/db/src/common.rs +++ b/server-api/db/src/common.rs @@ -4,7 +4,12 @@ use async_trait::async_trait; use crate::Response; use crate::UBigInt; -pub const NO_CONN_MSG: &'static str = "No connection could be established"; +#[macro_export] +macro_rules! no_conn { + ($spec:literal) => { + format!("No connection could be established: {}", $spec) + } +} /* * NOTE: pay attention to work on async in traits for rust diff --git a/server-api/db/src/lib.rs b/server-api/db/src/lib.rs index a67becb..759fde4 100644 --- a/server-api/db/src/lib.rs +++ b/server-api/db/src/lib.rs @@ -1,6 +1,7 @@ mod member; mod common; mod invites; +mod channels; use std::vec::Vec;