summaryrefslogtreecommitdiff
path: root/xmake/core/sandbox/modules/try.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-02-12 22:33:42 +0800
committerruki <[email protected]>2019-02-12 09:22:17 +0800
commitd7194331ea134b0e1b54a5e09a59824b9c399d83 (patch)
treeac95a37d84e5b489a2a619d1b393283bfa1a6c52 /xmake/core/sandbox/modules/try.lua
parent25bd4311c541cbf6329b8a309d8d47ceeaee5184 (diff)
improve diagnosis info
Diffstat (limited to 'xmake/core/sandbox/modules/try.lua')
-rw-r--r--xmake/core/sandbox/modules/try.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/core/sandbox/modules/try.lua b/xmake/core/sandbox/modules/try.lua
index 434f45ae6..aadcfefcf 100644
--- a/xmake/core/sandbox/modules/try.lua
+++ b/xmake/core/sandbox/modules/try.lua
@@ -34,18 +34,23 @@ local sandbox_try = sandbox_try or {}
-- traceback
function sandbox_try._traceback(errors)
- -- not verbose?
+ -- no diagnosis info?
if not option.get("diagnosis") then
if errors then
-- remove the prefix info
local _, pos = errors:find(":%d+: ")
if pos then
- return errors:sub(pos + 1)
+ errors = errors:sub(pos + 1)
end
end
return errors
end
+ -- traceback exists?
+ if errors and errors:find("stack traceback:", 1, true) then
+ return errors
+ end
+
-- init results
local results = ""
if errors then