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

Checking Exceptions throwing by KSP processor #325

Open
vdshb opened this issue Oct 18, 2022 · 1 comment
Open

Checking Exceptions throwing by KSP processor #325

vdshb opened this issue Oct 18, 2022 · 1 comment

Comments

@vdshb
Copy link

vdshb commented Oct 18, 2022

I want to check exception that my KSP processor throwing. But compilation.compile() is not re-throwing it, but logging instead:

e: Error occurred in KSP, check log for detail
e: [ksp] <... stack trace ...>

Is there an option to make com.tschuchort.compiletesting.KotlinCompilation#compile re-throw exceptions from KSP processor?

It's worth adding such option if it's not exist.

@tschuchortdev
Copy link
Owner

tschuchortdev commented Mar 6, 2023

I'll look at this later and see if there's any way to forward the exceptions but unfortunately I'm 90% sure that it won't be possible with the current implementation because KCT is essentially calling Kotlin compiler classes one level below the kotlinc CLI. At that point the Kotlin compiler will have already caught the exception and converted it to the CLI error message that you see in the logs. In any case I'll leave this ticket open as a reminder for a future rewrite that will call the compiler more directly and hopefully enable more introspection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants