Stack traces: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
(Update Lang example: Add line numbers)
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(4 intermediate revisions by 2 users not shown)
Line 622:
=={{header|Elena}}==
{{trans|C#}}
ELENA 56.0x :
<syntaxhighlight lang="elena">import extensions;
Line 650:
{{out}}
<pre>
mytestsandbox'program.inner[01]:testsandbox.l(7)
mytestsandbox'program.middle[01]:testsandbox.l(12)
mytestsandbox'program.outer[01]:testsandbox.l(17)
mytestsandbox'program.function:#invoke[0]:testsandbox.l(23)
system'$private'entry.function:#invoke[0]:win32_appapp.l(375)
system'$private'entrySymbol#startUpsym:win32_appapp.l(5544)
</pre>
 
Line 1,163:
fn.combA0(fp.f2)
 
# Partially called combinator functions' names can not be retrieved and are represented as "<comb...-func(...)>"
fn.combA(fn.combC(fn.combAE(), x), fp.f2)
</syntaxhighlight>
{{out}}
The file paths were redacted. If ":x" is outputted as the line number, no line number information is available (e.g. If langLang is implemented with an interpreter, predefined functions are written in the host langugelanguage)
<pre>
F2:
Line 1,197:
at "[redacted]:2" in function "fp.printStackTrace"
at "[redacted]:11" in function "fp.f2"
at "[redacted]:x" in function "<combcombAE-func()>"
at "[redacted]:x" in function "<combcombC-func(<combcombAE-func()>, <arg>)>"
at "[redacted]:x" in function "combA"
at "[redacted]:19" in function "main"
Line 1,206:
at "[redacted]:7" in function "fp.f1"
at "[redacted]:12" in function "fp.f2"
at "[redacted]:x" in function "<combcombAE-func()>"
at "[redacted]:x" in function "<combcombC-func(<combcombAE-func()>, <arg>)>"
at "[redacted]:x" in function "combA"
at "[redacted]:19" in function "main"
Line 2,262:
 
However, it is not possible to continue execution of the script afterwards. Whilst one can 'catch' such an error using Fiber.try() this will only allow you to inspect the error itself, not the chain of function calls that led up to it.
<syntaxhighlight lang="ecmascriptwren">var func2 = Fn.new {
Fiber.abort("Forced error.")
}
9,476

edits