Class: Dependabot::Uv::FileUpdater::LockFileErrorHandler

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/uv/file_updater/lock_file_error_handler.rb

Constant Summary collapse

UV_UNRESOLVABLE_REGEX =
T.let(/× No solution found when resolving dependencies.*[\s\S]*$/, Regexp)
UV_BUILD_FAILED_REGEX =
T.let(/× Failed to build.*[\s\S]*$/, Regexp)
RESOLUTION_IMPOSSIBLE_ERROR =
T.let("ResolutionImpossible", String)
GIT_DEPENDENCY_UNREACHABLE_REGEX =
T.let(%r{git clone.*(?<url>https?://[^\s]+)}, Regexp)
GIT_REFERENCE_NOT_FOUND_REGEX =
T.let(
  /Did not find branch or tag '(?<tag>[^\n"']+)'/m,
  Regexp
)
PYTHON_VERSION_ERROR_REGEX =
T.let(
  /Requires-Python|requires-python|python_requires|Python version/i,
  Regexp
)
AUTH_ERROR_REGEX =
T.let(
  /401|403|authentication|unauthorized|forbidden|HTTP status code: 40[13]/i,
  Regexp
)
TIMEOUT_ERROR_REGEX =
T.let(
  /timed?\s*out|connection.*reset|read timeout|connect timeout/i,
  Regexp
)
NETWORK_ERROR_REGEX =
T.let(
  /ConnectionError|NetworkError|SSLError|certificate verify failed/i,
  Regexp
)
PACKAGE_NOT_FOUND_REGEX =
T.let(
  /No matching distribution found|package.*not found|No versions found/i,
  Regexp
)
UV_REQUIRED_VERSION_REGEX =
T.let(
  /Required uv version `(?<required>[^`]+)` does not match the running version `(?<running>[^`]+)`/,
  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.

T.let(10, Integer)

Instance Method Summary collapse

Instance Method Details

#handle_uv_error(error) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/dependabot/uv/file_updater/lock_file_error_handler.rb', line 55

def handle_uv_error(error)
  message = error.message

  handle_required_version_errors(message)
  handle_resolution_errors(message)
  handle_git_errors(message)
  handle_authentication_errors(message)
  handle_network_errors(message)
  handle_python_version_errors(message)
  handle_resource_errors(message)
  handle_package_not_found_errors(message)

  raise error
end