Skip to content

Commit

Permalink
add note about intentional error for flowing control inside error
Browse files Browse the repository at this point in the history
handler.
  • Loading branch information
zbryikt committed Feb 25, 2025
1 parent a3e8beb commit 1d6ea0e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ls
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ ldcvmgr.prototype = Object.create(Object.prototype) <<< do
fire: (n, ...v) -> for cb in (@evt-handler[n] or []) => cb.apply @, v
zmgr: -> if it? => @_zmgr = it else @_zmgr
error: (n = '', e = {}, p = {}) ->
# sometimes we use error like 999 (cancel) to skip,
# however all errors from cover managed by ldcvmgr go here.
# TODO we probably will want to make it configurable to skip certain errors.
console.error e
if n == \error or n == @error-cover or n == @_id(@error-cover) =>
alert "something is wrong; please reload and try again"
Expand Down

0 comments on commit 1d6ea0e

Please sign in to comment.