Skip to content

Commit

Permalink
Add label to errno in error message for clarity
Browse files Browse the repository at this point in the history
Signed-off-by: Renan Magagnin <[email protected]>
  • Loading branch information
renanmagagnin committed Dec 10, 2024
1 parent 5112fcb commit 70a5f7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mountpoint-s3/src/fuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ macro_rules! event {
macro_rules! fuse_error {
($name:literal, $reply:expr, $err:expr) => {{
let err = $err;
event!(err.level, "{} {} failed: {:#}", $name, err.to_errno(), err);
event!(err.level, "{} Errno: {} failed: {:#}", $name, err.to_errno(), err);
::metrics::counter!("fuse.op_failures", "op" => $name).increment(1);
$reply.error(err.to_errno());
}};
Expand Down
2 changes: 1 addition & 1 deletion mountpoint-s3/tests/fuse_tests/fork_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ fn read_with_no_permissions_for_a_key_sse() {
read_result.expect("should be able to read a default-encrypted file after the first read failure");
}

let log_line_pattern = format!("^.*WARN.*{encrypted_object}.*read 5 failed: get request failed: get object request failed: Client error: Forbidden: User: .* is not authorized to perform: kms:Decrypt on resource: {key_id} because no session policy allows the kms:Decrypt action.*$");
let log_line_pattern = format!("^.*WARN.*{encrypted_object}.*read Errno: 5 failed: get request failed: get object request failed: Client error: Forbidden: User: .* is not authorized to perform: kms:Decrypt on resource: {key_id} because no session policy allows the kms:Decrypt action.*$");
let expected_log_line = regex::Regex::new(&log_line_pattern).unwrap();
unmount_and_check_log(child, mount_point.path(), &expected_log_line);
}
Expand Down

0 comments on commit 70a5f7c

Please sign in to comment.