From c3e979270956b8df9380cf9eea067048f325dbd3 Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Fri, 14 Aug 2020 13:25:48 +0200 Subject: Replace !! with some meaningful messages --- plugins/gfm/src/main/kotlin/GfmPlugin.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'plugins/gfm/src') diff --git a/plugins/gfm/src/main/kotlin/GfmPlugin.kt b/plugins/gfm/src/main/kotlin/GfmPlugin.kt index c758467a..c8f78c26 100644 --- a/plugins/gfm/src/main/kotlin/GfmPlugin.kt +++ b/plugins/gfm/src/main/kotlin/GfmPlugin.kt @@ -1,6 +1,8 @@ package org.jetbrains.dokka.gfm import org.jetbrains.dokka.CoreExtensions +import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet +import org.jetbrains.dokka.DokkaException import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.DefaultRenderer import org.jetbrains.dokka.base.renderers.PackageListCreator @@ -324,7 +326,11 @@ open class CommonmarkRenderer( } override suspend fun renderPage(page: PageNode) { - val path by lazy { locationProvider.resolve(page, skipExtension = true)!! } + val path by lazy { + locationProvider.resolve(page, skipExtension = true) + ?: throw DokkaException("Cannot resolve path for ${page.name}") + } + when (page) { is ContentPage -> outputWriter.write(path, buildPage(page) { c, p -> buildPageContent(c, p) }, ".md") is RendererSpecificPage -> when (val strategy = page.strategy) { @@ -359,5 +365,5 @@ class MarkdownLocationProvider( ) : DokkaLocationProvider( pageGraphRoot, dokkaContext, -".md" + ".md" ) \ No newline at end of file -- cgit