moved the InputValidationError to the top of server.rs

This commit is contained in:
jaensen 2023-03-30 04:30:34 +02:00
parent 949969b47e
commit ec0df1959e

View file

@ -21,6 +21,20 @@ struct JsonRpcRequest {
params: JsonValue,
}
struct InputValidationError(String);
impl Error for InputValidationError {}
impl Debug for InputValidationError {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "Error: {}", self.0)
}
}
impl Display for InputValidationError {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "Error: {}", self.0)
}
}
pub fn start_server(listen_at: &str, queue_size: usize, threads: u64) {
let edges: Arc<RwLock<Arc<EdgeDB>>> = Arc::new(RwLock::new(Arc::new(EdgeDB::default())));
@ -134,21 +148,6 @@ fn load_safes_binary(edges: &RwLock<Arc<EdgeDB>>, file: &str) -> Result<usize, B
Ok(len)
}
struct InputValidationError(String);
impl Debug for InputValidationError {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "Error: {}", self.0)
}
}
impl Display for InputValidationError {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "Error: {}", self.0)
}
}
impl Error for InputValidationError {}
fn compute_transfer(
request: JsonRpcRequest,
edges: &EdgeDB,