Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
dantengsky committed Aug 5, 2021
1 parent 308aec9 commit ab9f199
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion common/exception/src/exception.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ build_exceptions! {
Overflow(49),
InvalidMetaBinaryFormat(50),
AuthenticateFailure(51),
TLSConfigurationFailuer(52),
TLSConfigurationFailure(52),


// uncategorized
Expand Down
18 changes: 12 additions & 6 deletions common/flights/src/dns_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,18 @@ impl ConnectionFactory {

let mut endpoint = if let Some(conf) = rpc_client_config {
log::info!("tls rpc enabled");
let client_tls_config = Self::client_tls_config(&conf)
.await
.map_err(|e| ErrorCode::TLSConfigurationFailuer(e.to_string()))?;
builder
.tls_config(client_tls_config)
.map_err(|e| ErrorCode::TLSConfigurationFailuer(e.to_string()))?
let client_tls_config = Self::client_tls_config(&conf).await.map_err(|e| {
ErrorCode::TLSConfigurationFailure(format!(
"loading client tls config failure: {} ",
e.to_string()
))
})?;
builder.tls_config(client_tls_config).map_err(|e| {
ErrorCode::TLSConfigurationFailure(format!(
"builder tls_config failure: {}",
e.to_string()
))
})?
} else {
builder
};
Expand Down
4 changes: 2 additions & 2 deletions fusequery/query/src/api/rpc_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ impl RpcService {
log::info!("fuse query tls rpc enabled");
builder
.tls_config(Self::server_tls_config(&self.conf).await.map_err(|e| {
ErrorCode::TLSConfigurationFailuer(format!(
ErrorCode::TLSConfigurationFailure(format!(
"failed to load server tls config: {}",
e.to_string()
))
})?)
.map_err(|e| {
ErrorCode::TLSConfigurationFailuer(format!(
ErrorCode::TLSConfigurationFailure(format!(
"failed to invoke tls_config: {}",
e.to_string()
))
Expand Down
4 changes: 2 additions & 2 deletions fusequery/query/src/api/rpc_service_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async fn test_tls_rpc_server_invalid_server_config() -> Result<()> {
let r = srv.start_with_incoming(stream).await;
assert!(r.is_err());
let e = r.unwrap_err();
assert_eq!(e.code(), ErrorCode::TLSConfigurationFailuer("").code());
assert_eq!(e.code(), ErrorCode::TLSConfigurationFailure("").code());
Ok(())
}

Expand All @@ -103,6 +103,6 @@ async fn test_tls_rpc_server_invalid_client_config() -> Result<()> {
let r = ConnectionFactory::create_flight_channel("fake:1234", None, Some(client_conf)).await;
assert!(r.is_err());
let e = r.unwrap_err();
assert_eq!(e.code(), ErrorCode::TLSConfigurationFailuer("").code());
assert_eq!(e.code(), ErrorCode::TLSConfigurationFailure("").code());
Ok(())
}
3 changes: 1 addition & 2 deletions fusestore/store/src/api/rpc/tls_flight_service_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//
// SPDX-License-Identifier: Apache-2.0.

use common_datavalues::prelude::*;
use common_exception::ErrorCode;
use common_flights::MetaApi;
use common_flights::RpcClientTlsConfig;
Expand Down Expand Up @@ -71,7 +70,7 @@ async fn test_flight_tls_client_config_failure() -> anyhow::Result<()> {

assert!(r.is_err());
if let Err(e) = r {
assert_eq!(e.code(), ErrorCode::TLSConfigurationFailuer("").code());
assert_eq!(e.code(), ErrorCode::TLSConfigurationFailure("").code());
}
Ok(())
}
4 changes: 2 additions & 2 deletions fusestore/store/src/api/rpc_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl StoreServer {
let (fin_tx, fin_rx) = oneshot::channel::<()>();

let tls_conf = Self::tls_config(&self.conf).await.map_err(|e| {
ErrorCode::TLSConfigurationFailuer(format!(
ErrorCode::TLSConfigurationFailure(format!(
"failed to build ServerTlsConfig, {}",
e.to_string()
))
Expand Down Expand Up @@ -106,7 +106,7 @@ impl StoreServer {
let mut builder = if let Some(conf) = tls_conf {
tracing::info!("TLS RPC enabled");
builder.tls_config(conf).map_err(|e| {
ErrorCode::TLSConfigurationFailuer(format!(
ErrorCode::TLSConfigurationFailure(format!(
"server tls_config failure {}",
e.to_string()
))
Expand Down

0 comments on commit ab9f199

Please sign in to comment.