pub mod codec;
pub mod history;
pub mod mutate;
pub mod namespace;
pub mod schedule;
pub mod workflow;
#[derive(Debug, thiserror::Error)]
pub enum OpError {
#[error("{operation} failed: {message}")]
Rpc {
operation: &'static str,
code: String,
message: String,
},
#[error("{message}")]
Codec { message: String },
}
impl OpError {
pub(crate) fn rpc(operation: &'static str, status: temporalio_client::tonic::Status) -> Self {
Self::Rpc {
operation,
code: format!("{:?}", status.code()),
message: status.message().to_string(),
}
}
}