TypeAdapter(str).validate_python(project_key) can raise a pydantic.ValidationError, which won’t be caught by the CLI layer (it only catches UsethisError). Consider catching ValidationError here and re-raising as InvalidSonarQubeProjectKeyError with a message pointing to tool.usethis.sonarqube.project-key, so mis-typed config values produce a clean, user-facing error instead of a traceback.
Originally posted by @Copilot in #1439 (comment)