core
core copied to clipboard
Add error handling to all api routes
We can extend endpoint like get_name_resolve
, to return a custom error struct
#[get("/name/resolve/<name>?<chain>")]
pub async fn get_name_resolve(
name: &str,
chain: &str,
name_client: &State<Mutex<NameClient>>,
) -> Result<Json<NameRecord>, NotFound<String>> {
...
}