Skip to content

Commit e166f17

Browse files
Luke OsborneLuke Osborne
authored andcommitted
database-utils: Provide more detail on parse failure.
If the upstream db url fails to parse due to special characters in the password, it can result in confusing error messages like "Invalid port number" because the parser doesn't fail until a later element in the uri. This commit adds more detail to the error message recommending that the user percent-encode special characters as well as point to our public documentation (since there may be other issues that cause the url to fail parsing, and it's not easy to provide detailed guidance for every possible case). Release-Note-Core: Provided a better error message and guidance for passwords that include special characters, which must be percent-encoded. Change-Id: I86a8f0ef3cc57eb9b1a9a0d956826c407002bc47 Reviewed-on: https://gerrit.readyset.name/c/readyset/+/5837 Reviewed-by: Dan Wilbanks <[email protected]> Tested-by: Buildkite CI
1 parent c92db77 commit e166f17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

database-utils/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ pub enum DatabaseURLParseError {
6969
#[error("Invalid database URL format; ReadySet requires that Postgres database URLs contain a database name")]
7070
MissingPostgresDbName,
7171

72-
#[error(transparent)]
72+
#[error("Invalid database URL format: {0}; Make sure any special characters are percent-encoded. See https://docs.readyset.io/reference/cli/readyset#--upstream-db-url for more details.")]
7373
PostgreSQL(#[from] pgsql::Error),
7474

75-
#[error(transparent)]
75+
#[error("Invalid database URL format: {0}; Make sure any special characters are percent-encoded. See https://docs.readyset.io/reference/cli/readyset#--upstream-db-url for more details.")]
7676
MySQL(#[from] mysql::UrlError),
7777
}
7878

0 commit comments

Comments
 (0)