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

Function errorCb

src/astroprint/api/cloud.py:224–244  ·  view source on GitHub ↗
(destFile, error)

Source from the content-addressed store, hash-verified

222 )
223
224 def errorCb(destFile, error):
225 if error == 'cancelled':
226 em.fire(
227 Events.CLOUD_DOWNLOAD,
228 {
229 "type": "cancelled",
230 "id": print_file_id
231 }
232 )
233 else:
234 em.fire(
235 Events.CLOUD_DOWNLOAD,
236 {
237 "type": "error",
238 "id": print_file_id,
239 "reason": error
240 }
241 )
242
243 if destFile and os.path.exists(destFile):
244 os.remove(destFile)
245
246 if astroprintCloud().download_print_file(print_file_id, progressCb, successCb, errorCb) is True:
247 return jsonify(SUCCESS)

Callers 3

download_print_fileMethod · 0.85
runMethod · 0.85

Calls 2

fireMethod · 0.80
removeMethod · 0.80

Tested by

no test coverage detected