We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d91d5e1 commit 6aedd90Copy full SHA for 6aedd90
lib/importmap/npm.rb
@@ -80,6 +80,10 @@ def get_json(uri)
80
http.request(request)
81
}
82
83
+ unless response.kind_of? Net::HTTPSuccess
84
+ raise HTTPError, "Unexpected error response #{response.code}: #{response.body}"
85
+ end
86
+
87
response.body
88
rescue => error
89
raise HTTPError, "Unexpected transport error (#{error.class}: #{error.message})"
@@ -111,6 +115,9 @@ def get_audit
111
115
return {} if body.empty?
112
116
113
117
response = post_json(uri, body)
118
119
120
114
121
JSON.parse(response.body)
122
end
123
0 commit comments