Skip to content

Commit

Permalink
fixed pcall catching quota errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MechWipf committed Feb 16, 2014
1 parent c6eca2d commit 05cfd8a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lua/starfall/libs_sh/builtins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,16 @@ function SF.DefaultEnvironment.dofile(file)
end

--- Lua's pcall function
SF.DefaultEnvironment.pcall = pcall
function SF.DefaultEnvironment.pcall ( ... )
ok, err = pcall( ... )

-- don't catch quota errors
if SF.instance.ops > SF.instance.context.ops then
error( err, 0 )
end

return ok, err
end

--- GLua's loadstring, modified for safe use in Starfall
-- Works like loadstring, except that it executes by default in the main environment
Expand Down

0 comments on commit 05cfd8a

Please sign in to comment.