mirror of
https://github.com/littensy/charm.git
synced 2026-10-22 12:41:37 +00:00
refactor: keep error level in some cases
This commit is contained in:
parent
890ff2cf07
commit
1f4c7c7a65
1 changed files with 7 additions and 7 deletions
|
|
@ -441,7 +441,7 @@ local function signal<T>(initialValue: T, equals: Equals<T>?): (Getter<T>, Sette
|
||||||
if success then
|
if success then
|
||||||
value = result
|
value = result
|
||||||
else
|
else
|
||||||
error(result, 0)
|
error(result, 2)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
value = update
|
value = update
|
||||||
|
|
@ -558,7 +558,7 @@ local function computed<T>(getter: (previousValue: T?) -> T): Getter<T>
|
||||||
if success then
|
if success then
|
||||||
this.value = result
|
this.value = result
|
||||||
else
|
else
|
||||||
error(result, 0)
|
error(result, 2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -603,7 +603,7 @@ local function effect(fn: () -> ...Cleanup?): Cleanup
|
||||||
activeSub = prevSub
|
activeSub = prevSub
|
||||||
|
|
||||||
if not success then
|
if not success then
|
||||||
error(result, 0)
|
error(result, 2)
|
||||||
elseif result then
|
elseif result then
|
||||||
table.insert(this.cleanups, noYield(result))
|
table.insert(this.cleanups, noYield(result))
|
||||||
end
|
end
|
||||||
|
|
@ -637,7 +637,7 @@ local function effectScope(fn: () -> ...Cleanup?, detached: boolean?): Cleanup
|
||||||
activeSub = prevSub
|
activeSub = prevSub
|
||||||
|
|
||||||
if not success then
|
if not success then
|
||||||
error(result, 0)
|
error(result, 2)
|
||||||
elseif result then
|
elseif result then
|
||||||
table.insert(this.cleanups, noYield(result))
|
table.insert(this.cleanups, noYield(result))
|
||||||
end
|
end
|
||||||
|
|
@ -664,7 +664,7 @@ local function trigger(fn: () -> ())
|
||||||
activeSub = prevSub
|
activeSub = prevSub
|
||||||
|
|
||||||
if not success then
|
if not success then
|
||||||
error(result, 0)
|
error(result, 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
local link = sub.deps
|
local link = sub.deps
|
||||||
|
|
@ -721,7 +721,7 @@ local function untracked<Args..., Results...>(fn: (Args...) -> Results..., ...:
|
||||||
activeSub = prevSub
|
activeSub = prevSub
|
||||||
|
|
||||||
if not results[1] then
|
if not results[1] then
|
||||||
error(results[2], 0)
|
error(results[2], 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
return unpack(results, 2)
|
return unpack(results, 2)
|
||||||
|
|
@ -745,7 +745,7 @@ local function batch<Args..., Results...>(fn: (Args...) -> Results..., ...: Args
|
||||||
endBatch()
|
endBatch()
|
||||||
|
|
||||||
if not results[1] then
|
if not results[1] then
|
||||||
error(results[2], 0)
|
error(results[2], 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
return unpack(results, 2)
|
return unpack(results, 2)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue