Skip to content

feat: Polish error output for thrift errors #13412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/query/storages/hive/hive/src/hive_catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,13 @@ impl HiveCatalog {
pub fn get_client(&self) -> Result<impl TThriftHiveMetastoreSyncClient> {
let mut c = TTcpChannel::new();
c.open(self.client_address.as_str())
.map_err(from_thrift_error)?;
.map_err(from_thrift_error)
.map_err(|err| {
err.add_message_back(format!(
"hive_metadatastore_address: {}",
self.client_address.as_str()
))
})?;
let (i_chan, o_chan) = c.split().map_err(from_thrift_error)?;
let i_tran = TBufferedReadTransport::new(i_chan);
let o_tran = TBufferedWriteTransport::new(o_chan);
Expand Down Expand Up @@ -334,7 +340,10 @@ impl HiveCatalog {
}

fn from_thrift_error(error: thrift::Error) -> ErrorCode {
ErrorCode::from_std_error(error)
ErrorCode::Internal(format!(
"thrift error: {:?}, please check your thrift client config",
error
))
}

#[async_trait::async_trait]
Expand Down