Skip to content

Commit 9804428

Browse files
committed
add some better error logging
1 parent 0214e25 commit 9804428

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

_plugins/pyproject-loader.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module PyProjectLoader
1919
collection.docs.each{|mod|
2020
if !mod.data.key?("pyproject_url") then
2121
if !mod.data.key?("legacy") then
22-
Jekyll.logger.error("#{mod.path}: no pyproject url")
22+
raise "#{mod.path}: no pyproject url"
2323
end
2424
next
2525
end
@@ -35,16 +35,20 @@ module PyProjectLoader
3535
redirects -= 1
3636
end while resp.is_a?(Net::HTTPRedirection) && redirects > 0
3737
rescue => e
38-
Jekyll.logger.error("#{mod.path}: failed to download pyproject: #{e}")
39-
next
38+
Jekyll.logger.error("#{mod.path}: failed to download pyproject at #{url}")
39+
raise
4040
end
4141

4242
if !resp.is_a?(Net::HTTPSuccess) then
43-
Jekyll.logger.error("#{mod.path}: failed to download pyproject: #{resp.code}")
44-
next
43+
raise "#{mod.path}: failed to download pyproject at #{url}: #{resp.code}"
4544
end
4645

47-
pyproject = PerfectTOML.parse(resp.body)
46+
begin
47+
pyproject = PerfectTOML.parse(resp.body)
48+
rescue => e
49+
Jekyll.logger.error("#{mod.path}: failed to parse pyproject at #{url}")
50+
raise
51+
end
4852
mod.data["pyproject"] = pyproject
4953

5054
# Replace the title with that from the pyproject

0 commit comments

Comments
 (0)