1pub mod codec;
7pub mod history;
8pub mod mutate;
9pub mod namespace;
10pub mod schedule;
11pub mod workflow;
12
13#[derive(Debug, thiserror::Error)]
14pub enum OpError {
15 #[error("{operation} failed: {message}")]
16 Rpc {
17 operation: &'static str,
18 code: String,
19 message: String,
20 },
21 #[error("{message}")]
23 Codec { message: String },
24}
25
26impl OpError {
27 pub(crate) fn rpc(operation: &'static str, status: temporalio_client::tonic::Status) -> Self {
28 Self::Rpc {
29 operation,
30 code: format!("{:?}", status.code()),
31 message: status.message().to_string(),
32 }
33 }
34}