Skip to content

Commit

Permalink
Explicitly return error on incorrect scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnBakhmat committed May 31, 2024
1 parent 105358c commit dd8766c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gleam/pgo.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ pub fn url_config(database_url: String) -> Result(Config, Nil) {
path: path,
..,
) -> {
let assert True = list.contains(["postgres", "postgresql"], scheme)
Ok(#(userinfo, host, path, db_port))
case list.contains(["postgres", "postgresql"], scheme) {
True -> Ok(#(userinfo, host, path, db_port))
False -> Error(Nil)
}
}
_ -> Error(Nil)
})
Expand Down

0 comments on commit dd8766c

Please sign in to comment.