diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-08-04 10:54:43 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-08-04 10:54:43 +0100 |
commit | 5f232e4aaaad5b56d970a425c532e95240f82491 (patch) | |
tree | b87633788132df1b89a81d58e819f5bf79b2b4fd /example/simple-example.lua | |
parent | bfbad391533d99e072fde43c774d60c1d9f80f8e (diff) | |
download | supple-5f232e4aaaad5b56d970a425c532e95240f82491.tar.gz |
SUPPLE: Better support for error messages, show them in the example
Diffstat (limited to 'example/simple-example.lua')
-rw-r--r-- | example/simple-example.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/example/simple-example.lua b/example/simple-example.lua index 33f62e8..327167f 100644 --- a/example/simple-example.lua +++ b/example/simple-example.lua @@ -44,3 +44,12 @@ setmetatable(tab, mt) -- Finally, run the subcode print(supple.host.run(subcode, "@test-code", tab)) assert(tab.tot == 24) + +-- Now run a supple command which we expect to error out. +print(supple.host.run("unknown()", "@test-code")) + +-- And now, one where we pass an error from host to sandbox and back +print(supple.host.run("local f = ... f()", "@test-code", function() unknown() end)) + +-- And now, one where we pass an error from sandbox to host to sandbox and back +print(supple.host.run("local f = ... f(function() unknown() end)", "@test-code", function(ff) ff() end)) |