pub fn default_error_handler(error: Error) -> tonic::Status {
    match error {
        Error::IdNotSet => PreconditionViolation {
            category: "Writer ID".to_string(),
            subject: "influxdata.com/iox".to_string(),
            description: "Writer ID must be set".to_string(),
        }
        .into(),
        Error::DatabaseNotFound { db_name } => NotFound {
            resource_type: "database".to_string(),
            resource_name: db_name,
            ..Default::default()
        }
        .into(),
        error => {
            error!(?error, "Unexpected error");
            InternalError {}.into()
        }
    }
}
/// map common server errors  to the appropriate tonic Status
map common server errors  to the appropriate tonic Status
map common server errors to the appropriate tonic Status
pub fn default_error_handler(error: Error) -> tonic::Status {
    match error {
        Error::IdNotSet => PreconditionViolation {
            category: "Writer ID".to_string(),
            subject: "influxdata.com/iox".to_string(),
            description: "Writer ID must be set".to_string(),
        }
        .into(),
        Error::DatabaseNotFound { db_name } => NotFound {
            resource_type: "database".to_string(),
            resource_name: db_name,
            ..Default::default()
        }
        .into(),
        error => {
            error!(?error, "Unexpected error");
            InternalError {}.into()
        }
    }
}
pub fn default_error_handler ( error : Error ) -> tonic :: Status { match error { Error :: IdNotSet => PreconditionViolation { category : " " . to_string ( ) , subject : " " . to_string ( ) , description : " " . to_string ( ) , } . into ( ) , Error :: DatabaseNotFound { db_name } => NotFound { resource_type : " " . to_string ( ) , resource_name : db_name , .. Default :: default ( ) } . into ( ) , error => { error ! ( error " " ) ; InternalError { } . into ( ) } } }
map common server errors  to the appropriate tonic Status
map common server errors to the appropriate tonic Status
error
Error
error
Error