You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 8, 2024. It is now read-only.
if fileUrl andfileUrl.protocolin ['http:', 'https:'] andfileUrl.host
103
+
downloadFile fileUrlOrPath, loadCallback
104
+
else
105
+
readLocalFile fileUrlOrPath, loadCallback
106
+
107
+
, (err) ->
94
108
returncallback(err, stats) if err
95
109
cb()
96
110
111
+
downloadFile= (fileUrl, downloadCallback) ->
112
+
request.get
113
+
url: fileUrl
114
+
timeout:5000
115
+
json:false
116
+
, (downloadError, res, body) ->
117
+
if downloadError
118
+
downloadCallback {message:"Error when loading file from URL '#{fileUrl}'. Is the provided URL correct?"}
119
+
elseifnot body orres.statusCode<200orres.statusCode>=300
120
+
downloadCallback {message:"Unable to load file from URL '#{fileUrl}'. Server did not send any blueprint back and responded with status code #{res.statusCode}."}
0 commit comments