MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / abort

Method abort

ui/media/js/engine.js:389–412  ·  view source on GitHub ↗
(exception)

Source from the content-addressed store, hash-verified

387 return this.#exception
388 }
389 async abort(exception) {
390 if (this.isCompleted || this.isStopped || this.hasFailed) {
391 return
392 }
393 if (typeof exception !== "undefined") {
394 if (typeof exception === "string") {
395 exception = new Error(exception)
396 }
397 if (typeof exception !== "object") {
398 throw new Error("exception is not an object.")
399 }
400 if (!(exception instanceof Error)) {
401 throw new Error("exception is not an Error or a string.")
402 }
403 }
404 const res = await fetch("/image/stop?task=" + this.id)
405 if (!res.ok) {
406 console.log("Stop response:", res)
407 throw new Error(res.statusText)
408 }
409 task_queue.delete(this)
410 this.#exception = exception
411 this.#status = exception ? TaskStatus.failed : TaskStatus.stopped
412 }
413
414 get reqBody() {
415 if (this.#status === TaskStatus.init) {

Callers 8

postMethod · 0.95
readerMethod · 0.80
postMethod · 0.80
startMethod · 0.80
postMethod · 0.80
startMethod · 0.80
abortTaskFunction · 0.80

Calls 1

deleteMethod · 0.80

Tested by

no test coverage detected