Skip to content

Commit

Permalink
Included regex as per the review comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
“Thavachelvam committed Feb 5, 2025
1 parent bf4ea7d commit 80c7f0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion npm_and_yarn/lib/dependabot/npm_and_yarn/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ def self.package_manager_run_command(name, command, fingerprint: nil)
result
rescue StandardError => e
Dependabot.logger.error("Error running package manager command: #{full_command}, Error: #{e.message}")
if e.message.include?("\e[38;5;111mResponse Code\e[39m: \e[38;5;220m404\e[39m (Not Found)\n") &&
if e.message.match?(/Response Code.*:.*404.*\(Not Found\)/) &&
e.message.include?("The remote server failed to provide the requested resource")
raise RegistryError.new(404, "The remote server failed to provide the requested resource")
end
Expand Down
2 changes: 1 addition & 1 deletion npm_and_yarn/spec/dependabot/npm_and_yarn/helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@

expect do
described_class.package_manager_run_command("npm", "install")
end.to raise_error(RegistryError, "The remote server failed to provide the requested resource")
end.to raise_error(Dependabot::RegistryError, "The remote server failed to provide the requested resource")
end
end

Expand Down

0 comments on commit 80c7f0a

Please sign in to comment.