Zettelkasten Forum


[SOLVED] Cancel plugin execution

edited November 19 in Resolved Issues

https://forum.zettelkasten.de/discussion/2994/bug-extract-note-null-check#latest

Plugins currently can only cancel by throwing an error, which then is shown to the user as an error. That's not good.

cancel() or some such would help.

Or a special error type that signals stack unwinding and cancellation.

Post edited by ctietze on

Author at Zettelkasten.de • https://christiantietze.de/

Comments

  • edited September 25

    The next update will ship with a cancel() function.

    Alternatives considered:

    • throw new Cancellation() -- I checked whether using JavaScript errors to 'unwind the stack' would be a good idea, but error propagation into the hosting app is very brittle. Function calls are easier in that regard.
    • exit(), potentially with result value, like bash scripts and C would offer

    Tell me what you think about this!

    Post edited by ctietze on

    Author at Zettelkasten.de • https://christiantietze.de/

  • cancel() was implemented in an October release

    Author at Zettelkasten.de • https://christiantietze.de/

Sign In or Register to comment.