diff --git a/src/connector/src/schema/avro.rs b/src/connector/src/schema/avro.rs index 375d71b6b74a7..553f6e71efca9 100644 --- a/src/connector/src/schema/avro.rs +++ b/src/connector/src/schema/avro.rs @@ -95,16 +95,10 @@ async fn fetch_schema_inner( let client = Client::new(urls, client_config)?; let key_subject = get_subject_by_strategy(name_strategy, topic, key_record_name, true)?; - let key_schema = client - .get_schema_by_subject(&key_subject) - .await - .map_err(SchemaFetchError::Request)?; + let key_schema = client.get_schema_by_subject(&key_subject).await?; let val_subject = get_subject_by_strategy(name_strategy, topic, val_record_name, false)?; - let val_schema = client - .get_schema_by_subject(&val_subject) - .await - .map_err(SchemaFetchError::Request)?; + let val_schema = client.get_schema_by_subject(&val_subject).await?; Ok((key_schema, val_schema)) } diff --git a/src/connector/src/schema/mod.rs b/src/connector/src/schema/mod.rs index 8f9cdca539f76..ddf98be990c7b 100644 --- a/src/connector/src/schema/mod.rs +++ b/src/connector/src/schema/mod.rs @@ -39,8 +39,8 @@ impl From for risingwave_common::error::RwError { pub enum SchemaFetchError { #[error(transparent)] InvalidOption(#[from] InvalidOptionError), - #[error("schema registry client error")] - Request(#[source] schema_registry::ConcurrentRequestError), + #[error(transparent)] + Request(#[from] schema_registry::ConcurrentRequestError), #[error("schema compilation error")] SchemaCompile(#[source] risingwave_common::error::BoxedError), #[error(transparent)] diff --git a/src/connector/src/schema/schema_registry/client.rs b/src/connector/src/schema/schema_registry/client.rs index 946563cacf393..f53274592fe4a 100644 --- a/src/connector/src/schema/schema_registry/client.rs +++ b/src/connector/src/schema/schema_registry/client.rs @@ -62,7 +62,7 @@ pub struct Client { } #[derive(Debug, thiserror::Error)] -#[error("{context}, errs: {errs:?}")] +#[error("all request confluent registry all timeout, {context}, errs: {errs:?}")] pub struct ConcurrentRequestError { errs: Vec>, context: String, @@ -147,10 +147,7 @@ impl Client { Err(ConcurrentRequestError { errs, - context: format!( - "all request confluent registry all timeout, req path {:?}, urls {:?}", - path, self.url - ), + context: format!("req path {:?}, urls {:?}", path, self.url), }) }