bit better error handling
This commit is contained in:
@ -7,7 +7,7 @@ use crate::error::*;
|
||||
pub fn endpoint(endpoint: &str, input: serde_json::Value) -> Result<serde_json::Value, Error> {
|
||||
match endpoint {
|
||||
"echo" => Ok(serde_json::to_value(echo(serde_json::from_value(input)?))?),
|
||||
_ => Err(Error::new(ErrorKind::InvalidEndpoint)),
|
||||
_ => Err(Error::new(ErrorKind::InvalidEndpointError)),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user