Skip to content

Commit

Permalink
fix: do not print the db url on error (#2725)
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos authored May 23, 2024
1 parent cbaefeb commit 40296f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions waku/common/databases/dburl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ proc validateDbUrl*(dbUrl: string): Result[string, string] =
if "sqlite" in dbUrl or dbUrl == "" or dbUrl == "none" or dbUrl.match(regex):
return ok(dbUrl)
else:
return err("invalid 'db url' option format: " & dbUrl)
return err("invalid 'db url' option format")

proc getDbEngine*(dbUrl: string): Result[string, string] =
let dbUrlParts = dbUrl.split("://", 1)

if dbUrlParts.len != 2:
return err("Incorrect dbUrl : " & dbUrl)
return err("Incorrect dbUrl")

let engine = dbUrlParts[0]
return ok(engine)
Expand All @@ -23,7 +23,7 @@ proc getDbPath*(dbUrl: string): Result[string, string] =
let dbUrlParts = dbUrl.split("://", 1)

if dbUrlParts.len != 2:
return err("Incorrect dbUrl : " & dbUrl)
return err("Incorrect dbUrl")

let path = dbUrlParts[1]
return ok(path)

0 comments on commit 40296f9

Please sign in to comment.