fix: do not print the db url on error (#2725)

This commit is contained in:
richΛrd 2024-05-23 18:37:04 -04:00 committed by GitHub
parent cbaefeb3ea
commit 40296f9dbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -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)
@ -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)