Skip to content

Commit 1dff124

Browse files
bastelfreakekohl
authored andcommitted
Catch Faraday::ResourceNotFound when a module is missing on forge.puppet.com
1 parent bd9cd5c commit 1dff124

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/metadata_json_deps.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ def initialize(cache = {})
99

1010
def get_module(name)
1111
name = PuppetForge::V3.normalize_name(name)
12-
@cache[name] ||= PuppetForge::Module.find(name)
12+
begin
13+
@cache[name] ||= PuppetForge::Module.find(name)
14+
rescue Faraday::ResourceNotFound
15+
raise PuppetForge::ModuleNotFound.new("Dependency #{name} not found on forge.puppet.com")
16+
end
1317
end
1418
end
1519

0 commit comments

Comments
 (0)