Skip to content

Conversation

@whyoleg
Copy link
Collaborator

@whyoleg whyoleg commented Sep 15, 2025

Handle InvocationTargetException exception explicitly in DokkaBootstrap to show better error messages in DGPv2, as Gradle will not show the cause of InvocationTargetException without --stacktrace flag

Fixes #4235

…strap` to show better error messages in DGPv2, as Gradle will not show the cause of `InvocationTargetException` without `--stacktrace` flag

Fixes #4235
@whyoleg whyoleg self-assigned this Sep 15, 2025
@whyoleg whyoleg added this to the Dokka 2.1.0 milestone Sep 15, 2025

class DokkaGeneratorFailureTest : FunSpec({
context("DokkaGenerator failure:") {
val project = gradleKtsProjectTest("dokka-generator-failure") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this test more straightforward? Or even add one more with a custom exception/pre-generation check?
For example, if intersecting roots are allowed in the future, this case could be lost.
See the original test

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice idea!
I will add an additional test similar to the previous one.

It would still be nice to have a functional test for DGP, so that we really show the exception from checks or just failures here.

@whyoleg whyoleg merged commit 29d5cbc into master Sep 18, 2025
14 checks passed
@whyoleg whyoleg deleted the whyoleg/fix-dgp-errors branch September 18, 2025 09:41
@adam-enko
Copy link
Member

post merge review: Looks good!

I think the ServiceLoader implementation would also help with error handling #4216

whyoleg added a commit that referenced this pull request Oct 13, 2025
…strap` (#4257)

Fixes #4235

Show better error messages in DGPv2, as Gradle will not show the cause of `InvocationTargetException` without `--stacktrace` flag

(cherry picked from commit 29d5cbc)
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

Successfully merging this pull request may close these issues.

Error about intersected source sets is not visible by default

4 participants