aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-02-12 14:27:15 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-02-12 14:29:06 +0100
commit944695d967c2f93e41e4bfd640238f3e9b1c9434 (patch)
treeb8d8e5e7a22240ebf64bcda50078f63d2251be64 /core/src/main/kotlin
parent135a3118cf9d08bb50ff0c438b60508ecf1994c6 (diff)
downloaddokka-944695d967c2f93e41e4bfd640238f3e9b1c9434.tar.gz
dokka-944695d967c2f93e41e4bfd640238f3e9b1c9434.tar.bz2
dokka-944695d967c2f93e41e4bfd640238f3e9b1c9434.zip
Changed Errors to IllegalStateExcpetions
Diffstat (limited to 'core/src/main/kotlin')
-rw-r--r--core/src/main/kotlin/parsers/MarkdownParser.kt10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/src/main/kotlin/parsers/MarkdownParser.kt b/core/src/main/kotlin/parsers/MarkdownParser.kt
index d70a2239..74569bd7 100644
--- a/core/src/main/kotlin/parsers/MarkdownParser.kt
+++ b/core/src/main/kotlin/parsers/MarkdownParser.kt
@@ -35,7 +35,7 @@ class MarkdownParser (
DocNodesFromIElementFactory.getInstance(
node.type,
visitNode(node.children.find { it.type == MarkdownTokenTypes.ATX_CONTENT } ?:
- throw Error("Wrong AST Tree. ATX Header does not contain expected content")).children
+ throw IllegalStateException("Wrong AST Tree. ATX Header does not contain expected content")).children
)
private fun horizontalRulesHandler(node: ASTNode): DocTag =
@@ -100,13 +100,13 @@ class MarkdownParser (
declarationDescriptor,
null,
link.split('.')
- ).also { if (it.size > 1) throw Error("Markdown link resolved more than one element: $it") }.firstOrNull()//.single()
+ ).also { if (it.size > 1) throw IllegalStateException("Markdown link resolved more than one element: $it") }.firstOrNull()//.single()
?.let { DRI.from(it) }
}
private fun referenceLinksHandler(node: ASTNode): DocTag {
val linkLabel = node.children.find { it.type == MarkdownElementTypes.LINK_LABEL } ?:
- throw Error("Wrong AST Tree. Reference link does not contain expected content")
+ throw IllegalStateException("Wrong AST Tree. Reference link does not contain expected content")
val linkText = node.children.findLast { it.type == MarkdownElementTypes.LINK_TEXT } ?: linkLabel
val linkKey = text.substring(linkLabel.startOffset, linkLabel.endOffset)
@@ -118,9 +118,9 @@ class MarkdownParser (
private fun inlineLinksHandler(node: ASTNode): DocTag {
val linkText = node.children.find { it.type == MarkdownElementTypes.LINK_TEXT } ?:
- throw Error("Wrong AST Tree. Inline link does not contain expected content")
+ throw IllegalStateException("Wrong AST Tree. Inline link does not contain expected content")
val linkDestination = node.children.find { it.type == MarkdownElementTypes.LINK_DESTINATION } ?:
- throw Error("Wrong AST Tree. Inline link does not contain expected content")
+ throw IllegalStateException("Wrong AST Tree. Inline link does not contain expected content")
val linkTitle = node.children.find { it.type == MarkdownElementTypes.LINK_TITLE }
val link = text.substring(linkDestination.startOffset, linkDestination.endOffset)