mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Try improve error reporting
This commit is contained in:
parent
3b22f6ccf9
commit
58a31a1b32
16 changed files with 164 additions and 55 deletions
|
|
@ -1,5 +1,4 @@
|
|||
local flags = require "./flags"
|
||||
local throw = require "./throw"
|
||||
local graph = require "./graph"
|
||||
|
||||
local function batch(setter: () -> ())
|
||||
|
|
@ -11,14 +10,14 @@ local function batch(setter: () -> ())
|
|||
from = graph.get_update_queue_length()
|
||||
end
|
||||
|
||||
local ok, err: string? = pcall(setter)
|
||||
local ok, err: string? = xpcall(setter, debug.traceback)
|
||||
|
||||
if not already_batching then
|
||||
flags.batch = false
|
||||
graph.flush_update_queue(from)
|
||||
end
|
||||
|
||||
if not ok then throw(`error occured while batching updates: {err}`) end
|
||||
if not ok then error(`error occured while batching updates: {err}`, 0) end
|
||||
end
|
||||
|
||||
return batch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue