pub fn json(self) -> String {
    match self {
      Error::NotFound => r#"{"error":{"code":"error/not-found"}}"#.to_string(),
      Error::Hyper(_) => r#"{"error":{"code":"error/hyper"}}"#.to_string(),
      Error::Serde(_) => r#"{"error":{"code":"error/serde-json"}}"#.to_string(),
      Error::Postgres(_) => r#"{"error":{"code":"error/postgres-database"}}"#.to_string(),
    }
  }
// return the error message in json format
return the error message in json format
return the error message in json format
pub fn json(self) -> String {
    match self {
      Error::NotFound => r#"{"error":{"code":"error/not-found"}}"#.to_string(),
      Error::Hyper(_) => r#"{"error":{"code":"error/hyper"}}"#.to_string(),
      Error::Serde(_) => r#"{"error":{"code":"error/serde-json"}}"#.to_string(),
      Error::Postgres(_) => r#"{"error":{"code":"error/postgres-database"}}"#.to_string(),
    }
  }
pub fn json ( self ) -> String { match self { Error :: NotFound => r#"{"error":{"code":"error/not-found"}}"# . to_string ( ) , Error :: Hyper ( _ ) => r#"{"error":{"code":"error/hyper"}}"# . to_string ( ) , Error :: Serde ( _ ) => r#"{"error":{"code":"error/serde-json"}}"# . to_string ( ) , Error :: Postgres ( _ ) => r#"{"error":{"code":"error/postgres-database"}}"# . to_string ( ) , } }
return the error message in json format
return the error message in json format
self