Skip to content

Commit

Permalink
Demote .pgpass file warning to a debug message. (launchbadge#3548)
Browse files Browse the repository at this point in the history
  • Loading branch information
denschub authored and jrasanen committed Oct 14, 2024
1 parent bea29b9 commit bc16ad6
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 bc16ad6

Please sign in to comment.