Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

keep stacktrace when throws an exception #251

Merged
merged 4 commits into from
Jul 16, 2018
Merged

Conversation

Js-2nd
Copy link
Contributor

@Js-2nd Js-2nd commented Oct 25, 2017

Resolve #247

throw ex; will lose stack trace from where the exception is newed.
Instead, we can treat ex as an InnerException by throw new Exception(null, ex); to keep stack trace.
I grepped the source with grep 'throw [^n]' and made this PR.

reference(Japanese): http://ufcpp.net/study/csharp/misc_stacktrace.html

@Js-2nd
Copy link
Contributor Author

Js-2nd commented Oct 25, 2017

Oh, I just found out that this will break catch block or Observable.Catch since the original TException was wrapped by System.Exception, so you can't catch anything but System.Exception

@Js-2nd
Copy link
Contributor Author

Js-2nd commented May 31, 2018

I think it's done now.
@neuecc can you have a check?

@neuecc neuecc merged commit eb99514 into neuecc:master Jul 16, 2018
@neuecc
Copy link
Owner

neuecc commented Jul 16, 2018

sorry for too late, nice integration.
thanks.

EarMaster pushed a commit to EarMaster/UniRx that referenced this pull request Jun 12, 2019
keep stacktrace when throws an exception
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants