diff options
author | Steven Barth <steven@midlink.org> | 2008-03-24 15:39:32 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-03-24 15:39:32 +0000 |
commit | 06a385370c630a2e57412caf3a67ac77cc0e1b49 (patch) | |
tree | c93440d4623d17fa4094e9abe253b910edabdb5c /src/ffluci/util.lua | |
parent | ef01ff75db17f23a90757cf473778cfefe1ad120 (diff) |
* CBI: updates
* UCI: Introduced Session class, supporting different change file paths
* util: introduced sessionid() function
* general: Changed several error messages to OS native ones
Diffstat (limited to 'src/ffluci/util.lua')
-rw-r--r-- | src/ffluci/util.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ffluci/util.lua b/src/ffluci/util.lua index 8a526173d..38f33a20d 100644 --- a/src/ffluci/util.lua +++ b/src/ffluci/util.lua @@ -36,7 +36,10 @@ function class(base) setmetatable(inst, {__index = class}) if inst.__init__ then - inst:__init__(...) + local stat, err = pcall(inst.__init__, inst, ...) + if not stat then + error(err) + end end return inst @@ -138,6 +141,11 @@ function resfenv(f) end +-- Returns the Haserl unique sessionid +function sessionid() + return ENV.SESSIONID +end + -- Updates the scope of f with "extscope" function updfenv(f, extscope) local scope = getfenv(f) |