Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In our tests using the serde impl on `Url`, we found that failing URL serialization says the inverse of what it should say. ```toml [project] name = "foo" version = "0.0.0" dependencies = [ "tqdm ==4.66.0", ] [tool.uv.sources] tqdm = { url = "§invalid#+#*Ä" } ``` ``` error: Failed to parse: `pyproject.toml` Caused by: TOML parse error at line 10, column 16 | 10 | tqdm = { url = "§invalid#+#*Ä" } | ^^^^^^^^^^^^^^^^^ invalid value: string "§invalid#+#*Ä", expected relative URL without a base ``` It says that expected a relative URL without a base, when this was the unexpected input that caused the error. Using `serde::de::Error::custom` oder `serde::de::Error::invalid_value` improves the error message: ``` error: TOML parse error at line 8, column 16 | 8 | tqdm = { url = "§invalid#+#*Ä" } | ^^^^^^^^^^^^^^^^^ relative URL without a base: "§invalid#+#*Ä" ```
- Loading branch information