Merge pull request #2173 from influxdata/cn/better-error

fix: Return a more helpful error message for no matching sharding rule
pull/24376/head
kodiakhq[bot] 2021-08-02 21:04:05 +00:00 committed by GitHub
commit 24666e9bf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -38,7 +38,8 @@ pub fn default_server_error_handler(error: server::Error) -> tonic::Status {
description: "hard buffer limit reached".to_string(),
}
.into(),
source @ Error::WritingOnlyAllowedThroughWriteBuffer { .. } => tonic::Status::failed_precondition(source.to_string()),
source @ Error::WritingOnlyAllowedThroughWriteBuffer { .. } |
source @ Error::LineConversion { .. } => tonic::Status::failed_precondition(source.to_string()),
Error::NoRemoteConfigured { node_group } => NotFound {
resource_type: "remote".to_string(),
resource_name: format!("{:?}", node_group),

View File

@ -498,7 +498,9 @@ async fn test_write_dev_null() {
assert_eq!(
err.to_string(),
"Unexpected server error: Internal error: Internal Error"
"Unexpected server error: The system is not in a state required for the operation's \
execution: error converting line protocol to flatbuffers: Error getting shard id No \
sharding rule matches line: mem bar=1 1"
);
}