Difference between callStack and exceptionStack


I can’t really understand what is the difference between the callStack and the exceptionStack when an exception is thrown.
ExceptionStack seems to have more details, is it the right thing to look at when debugging please ?

I’ve seen the doc but its not clear for me :


Return the call stack elements, or an empty array if not available.

exceptionStack(fullStack:Bool = false):Array<StackItem>

Return the exception stack : this is the stack elements between the place the last exception was thrown and the place it was caught, or an empty array if not available. Set fullStack parameter to true in order to return the full exception stack.

May not work if catch type was a derivative from haxe.Exception.

Call stack points to a place where callStack() is invoked.
Exception stack points to a place where the exception was thrown.

Thanks for your answer Aleksandr but I don’t understand that ‘Call stack points to a place where callStack() is invoked.’
Maybe you could give me a pratical example ?

function main() {

function level1() {
    try {
    } catch(e:Dynamic) {
        //This will contain entries: main, level1, level2, level3
        //This will contain entries: main, level1

function level2() {

function level3() {
    throw "Terrible error";

Wow many thx Aleksandr, it’s clear now !
So for debugging, exceptionStack is the best, no doubt !