Class: Dependabot::Uv::FileUpdater::LockFileErrorHandler
- Inherits:
-
Object
- Object
- Dependabot::Uv::FileUpdater::LockFileErrorHandler
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/uv/file_updater/lock_file_error_handler.rb
Constant Summary collapse
- UV_UNRESOLVABLE_REGEX =
/× No solution found when resolving dependencies.*[\s\S]*$/- UV_BUILD_FAILED_REGEX =
/× Failed to build.*[\s\S]*$/- RESOLUTION_IMPOSSIBLE_ERROR =
"ResolutionImpossible"- GIT_DEPENDENCY_UNREACHABLE_REGEX =
%r{git clone.*(?<url>https?://[^\s]+)}- GIT_REFERENCE_NOT_FOUND_REGEX =
/Did not find branch or tag '(?<tag>[^\n"']+)'/m- GIT_CREDENTIALS_ERROR_REGEX =
/could not read Username for '(?<url>[^']+)'/- GIT_DEPENDENCY_URL_FROM_UV_REGEX =
%r{git\+(?<url>https?://[^\s@#]+)}- PYTHON_VERSION_ERROR_REGEX =
/Requires-Python|requires-python|python_requires|Python version/i- AUTH_ERROR_REGEX =
/authentication|unauthorized|forbidden|HTTP status code: 40[13]/i- TIMEOUT_ERROR_REGEX =
/timed?\s*out|connection.*reset|read timeout|connect timeout/i- NETWORK_ERROR_REGEX =
T.let( Regexp.union( /ConnectionError/i, /NetworkError/i, /SSLError/i, /certificate verify failed/i, /connection refused/i, /dns.*failed/i, /error sending request/i ), Regexp )
- PACKAGE_NOT_FOUND_REGEX =
/No matching distribution found|package.*not found|No versions found/i- UV_REQUIRED_VERSION_REGEX =
/Required uv version `(?<required>[^`]+)` does not match the running version `(?<running>[^`]+)`/- TOML_PARSE_ERROR_REGEX =
/Failed to parse:?\s*`?(?<file>[^`\n]+\.toml)`?|TOML parse error/i- USING_CPYTHON_LINE_REGEX =
uv prefixes errors with interpreter info that should be stripped
/\AUsing CPython \S+ interpreter at: [^\n]+\n?/- PYPROJECT_SCHEMA_ERROR_REGEX =
/missing field `project`|missing.*\[project\].*table|Field `project\.name` is required/i- WORKSPACE_MEMBER_ERROR_REGEX =
/Failed to find workspace member|No `pyproject\.toml` found in workspace member/i- PATH_DEPENDENCY_ERROR_REGEX =
/Failed to read `(?<path>[^`]+)`|failed to read from file `(?<path>[^`]+)`/i- HTTP_STATUS_ERROR_REGEX =
/HTTP status code: (?<code>\d{3})/i- UV_MISCONFIGURED_REGEX =
T.let( Regexp.union( /unknown field `[^`]+`, expected one of/i, /Unrecognized.*value:/i, /URL scheme `[^`]+` is not supported/i, /Failed to parse URL/i, /the argument '--[^']+' cannot be used/i ), Regexp )
- MAX_ERROR_LINES =
Maximum number of lines to include in cleaned error messages. This limit ensures error messages remain readable while providing enough context for debugging. Most uv error messages convey the key information within the first few lines.
10
Instance Method Summary collapse
Instance Method Details
#handle_uv_error(error) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/dependabot/uv/file_updater/lock_file_error_handler.rb', line 66 def handle_uv_error(error) = error. handle_required_version_errors() handle_pyproject_errors() handle_resolution_errors() handle_git_errors() handle_authentication_errors() handle_network_errors() handle_python_version_errors() handle_resource_errors() handle_package_not_found_errors() handle_uv_fallback_error() raise error end |