Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hl.Api.rethrow does not give full stack #42

Open
Gama11 opened this issue Feb 8, 2019 · 5 comments
Open

hl.Api.rethrow does not give full stack #42

Gama11 opened this issue Feb 8, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@Gama11
Copy link
Member

Gama11 commented Feb 8, 2019

Here's the callstack I get when the debugger breaks on the exception:

But this is what I get on the command line:

Shouldn't they match?

@Gama11 Gama11 added the question Further information is requested label Feb 8, 2019
@ncannasse
Copy link
Member

They should. But it seems in the VSCode case, the error is caught by Stage.__handleError and then rethrow. If there's a try/catch, not sure why it's not caught in commandline...

@ncannasse
Copy link
Member

Ah, maybe it's indeed caught & rethrow, but in the VSCode case the stack "up" from rethrow is not displayed. Uhm... I have to try reproducing this. Do you have the same result using the Node commandline debugger or is it only the HL one?

@Gama11
Copy link
Member Author

Gama11 commented Feb 8, 2019

Well, I can't debug OpenFL in Node.. :)

@ncannasse
Copy link
Member

Ok, it seems that indeed hl.Api.rethrow does not gives full stack trace in the debugger.
Some when you said "commandline" you meant running hl in the commandline, not when using the commandline debugger :) And when I said node, I was meaning using the node commandline debugger ;)

@ncannasse ncannasse changed the title Mismatch between callstack on command line and in debugger hl.Api.rethrow does no give full stack Feb 8, 2019
@ncannasse ncannasse changed the title hl.Api.rethrow does no give full stack hl.Api.rethrow does not give full stack Feb 8, 2019
@ncannasse
Copy link
Member

It can easily be reproduced by running this in debugger:

class Main {

	static function foo( x : Int ) : Int {
		if( x < 0 ) throw "!";
		return foo(x - 1) * 2;
	}

	static function main() {
		try {
			foo(10);
		} catch( e : Dynamic ) {
			hl.Api.rethrow(e);
		}
	}
}

@Gama11 Gama11 added bug Something isn't working and removed question Further information is requested labels Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants