Skip to content

Commit

Permalink
Demote .pgpass file warning to a debug message. (#3548)
Browse files Browse the repository at this point in the history
Fixes #3531
  • Loading branch information
denschub authored Oct 6, 2024
1 parent cadf152 commit 028084b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions sqlx-postgres/src/options/pgpass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,20 @@ fn load_password_from_file(
) -> Option<String> {
let file = File::open(&path)
.map_err(|e| {
tracing::warn!(
path = %path.display(),
"Failed to open `.pgpass` file: {e:?}",
);
match e.kind() {
std::io::ErrorKind::NotFound => {
tracing::debug!(
path = %path.display(),
"`.pgpass` file not found",
);
}
_ => {
tracing::warn!(
path = %path.display(),
"Failed to open `.pgpass` file: {e:?}",
);
}
};
})
.ok()?;

Expand Down

0 comments on commit 028084b

Please sign in to comment.