aboutsummaryrefslogtreecommitdiff
path: root/plugins/javadoc/src
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-08-14 13:25:48 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-19 13:34:10 +0200
commitc3e979270956b8df9380cf9eea067048f325dbd3 (patch)
treec4ebc524e68aabdf1f8486f2785ee783c28c66af /plugins/javadoc/src
parentcd52a20e56abcb15ebc11659bc79cac6a9b56a75 (diff)
downloaddokka-c3e979270956b8df9380cf9eea067048f325dbd3.tar.gz
dokka-c3e979270956b8df9380cf9eea067048f325dbd3.tar.bz2
dokka-c3e979270956b8df9380cf9eea067048f325dbd3.zip
Replace !! with some meaningful messages
Diffstat (limited to 'plugins/javadoc/src')
-rw-r--r--plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt
index e25a29fd..c811ace3 100644
--- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt
+++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt
@@ -3,6 +3,8 @@ package org.jetbrains.dokka.javadoc.renderer
import org.jetbrains.dokka.javadoc.location.JavadocLocationProvider
import org.jetbrains.dokka.javadoc.pages.*
import org.jetbrains.dokka.javadoc.renderer.SearchRecord.Companion.allTypes
+import org.jetbrains.dokka.DokkaConfiguration
+import org.jetbrains.dokka.DokkaException
import org.jetbrains.dokka.base.renderers.sourceSets
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.DisplaySourceSet
@@ -57,7 +59,7 @@ class SearchScriptsCreator(private val locationProvider: JavadocLocationProvider
val modules = SearchData(moduleRecords = input.map {
SearchRecord(
l = it.name,
- url = locationProvider.resolve(it)?.formatToEndWithHtml()
+ url = locationProvider.resolve(it).formatToEndWithHtml()
)
})
val processablePackages = input.flatMap { it.children.filterIsInstance<JavadocPackagePageNode>() }
@@ -68,7 +70,7 @@ class SearchScriptsCreator(private val locationProvider: JavadocLocationProvider
val packages = input.map {
SearchRecord(
l = it.name,
- url = locationProvider.resolve(it)?.formatToEndWithHtml()
+ url = locationProvider.resolve(it).formatToEndWithHtml()
)
} + SearchRecord.allPackages
val types = input.flatMap {
@@ -86,7 +88,7 @@ class SearchScriptsCreator(private val locationProvider: JavadocLocationProvider
SearchRecord(
p = it.first.name,
l = it.second.name,
- url = locationProvider.resolve(it.second)?.formatToEndWithHtml()
+ url = locationProvider.resolve(it.second).formatToEndWithHtml()
)
} + allTypes
val updated = accumulator.copy(typeRecords = types)
@@ -103,7 +105,7 @@ class SearchScriptsCreator(private val locationProvider: JavadocLocationProvider
packageName = it.first.name,
classlikeName = it.second.name,
input = function,
- url = locationProvider.resolve(function.dri, it.first.sourceSets())!!
+ url = locationProvider.resolve(function.dri, it.first.sourceSets()) ?: throw DokkaException("Cannot resolve path for ${function.dri}")
)
}
}
@@ -114,7 +116,7 @@ class SearchScriptsCreator(private val locationProvider: JavadocLocationProvider
packageName = it.first.name,
classlikeName = it.second.name,
property,
- locationProvider.resolve(property.dri, it.first.sourceSets())!!
+ locationProvider.resolve(property.dri, it.first.sourceSets())?: throw DokkaException("Cannot resolve path for ${property.dri}")
)
}
}
@@ -125,7 +127,7 @@ class SearchScriptsCreator(private val locationProvider: JavadocLocationProvider
packageName = it.first.name,
classlikeName = it.second.name,
entry,
- locationProvider.resolve(entry.dri, it.first.sourceSets())!!
+ locationProvider.resolve(entry.dri, it.first.sourceSets()) ?: throw DokkaException("Cannot resolve path for ${entry.dri}")
)
}
}