Skip to content

Commit

Permalink
fix: better bucket matching error (taking into account hostname) (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare authored Nov 3, 2022
1 parent fbdc6b5 commit 3d7d952
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions aw-query/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,15 @@ mod qfunctions {
match aw_transform::find_bucket(&bucket_filter, &hostname_filter, buckets.values()) {
Some(bucketname) => bucketname,
None => {
return Err(QueryError::BucketQueryError(format!(
"Couldn't find any bucket which starts with {}",
bucket_filter
)));
return Err(QueryError::BucketQueryError(match hostname_filter {
None => {
format!("Failed to find bucket matching filter '{}'", bucket_filter)
}
Some(hostname_filter) => format!(
"Failed to find bucket matching filter '{}' and hostname '{}'",
bucket_filter, hostname_filter
),
}));
}
};
Ok(DataType::String(bucketname))
Expand Down

0 comments on commit 3d7d952

Please sign in to comment.