MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / errorCb

Method errorCb

src/astroprint/plugin/services/files.py:309–330  ·  view source on GitHub ↗
(destFile, error)

Source from the content-addressed store, hash-verified

307 self.publishEvent('finished_download_printfile',data)
308
309 def errorCb(destFile, error):
310 if error == 'cancelled':
311 data = {
312 "type": "cancelled",
313 "id": printFileId
314 }
315
316 self.publishEvent('finished_download_printfile',data)
317 em.fire(Events.CLOUD_DOWNLOAD,data)
318
319 else:
320 data = {
321 "type": "error",
322 "id": printFileId,
323 "reason": error
324 }
325
326 em.fire(Events.CLOUD_DOWNLOAD,data)
327 self.publishEvent('finished_download_printfile',data)
328
329 if destFile and os.path.exists(destFile):
330 os.remove(destFile)
331
332 if astroprintCloud().download_print_file(printFileId, progressCb, successCb, errorCb) is True:
333 sendResponse({'success':'no error'})

Callers

nothing calls this directly

Calls 3

publishEventMethod · 0.80
fireMethod · 0.80
removeMethod · 0.80

Tested by

no test coverage detected