Skip to content

cytoscape.CancelledError

cytoscape.CancelledError — Getting started > Error types. Cytoscape.js signatures, parameters and return contract.

cytoscape.CancelledError — Getting started › Error types

Preview · Getting started › Error types

Read in the complete API reference · All API members

// Thrown (as a rejection) by a cancelled run: an async algorithm whose handle's cancel() was called, a layout's promise() after layout.cancel(), or either when cy.destroy() ran while the run was in flight
cytoscape.CancelledError: CancelledError

Thrown (as a rejection) by a cancelled run: an async algorithm whose handle's cancel() was called, a layout's promise() after layout.cancel(), or either when cy.destroy() ran while the run was in flight. error.name is 'CancelledError', so a .catch can tell a cancellation from a defect without importing the class.

Returns CancelledError

Example

const error = new cytoscape.CancelledError();
console.log(error instanceof cytoscape.CancelledError); // true

Example graph and handle setup