MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / downloadFile

Function downloadFile

web/scripts/ragnar_modern.js:13372–13386  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

13370 'Content-Type': 'application/json'
13371 },
13372 body: JSON.stringify(payload)
13373 });
13374
13375 let data = null;
13376 try {
13377 data = await response.json();
13378 } catch (error) {
13379 data = null;
13380 }
13381
13382 if (!response.ok || (data && data.success === false)) {
13383 const errorMessage = data && (data.error || data.message)
13384 ? (data.error || data.message)
13385 : `Request failed (${response.status})`;
13386 throw new Error(errorMessage);
13387 }
13388
13389 return data || { success: true };

Callers 1

previewFileFunction · 0.70

Calls 3

popMethod · 0.80
showFileSuccessFunction · 0.70

Tested by

no test coverage detected