improve exceptions
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.infendro.cli.command.context
|
||||
|
||||
import com.infendro.cli.command.Command
|
||||
import com.infendro.cli.exception.run.*
|
||||
import com.infendro.cli.error.run.*
|
||||
import com.infendro.cli.parser.Parser
|
||||
|
||||
internal class ContextParser(
|
||||
@@ -19,13 +19,13 @@ internal class ContextParser(
|
||||
|
||||
data class Failure(
|
||||
val command: Command,
|
||||
val error: RuntimeError,
|
||||
val error: RunError,
|
||||
) : Result()
|
||||
}
|
||||
|
||||
private fun success(context: Context) = Result.Success(context)
|
||||
private fun help(command: Command) = Result.Help(command)
|
||||
private fun failure(command: Command, exception: RuntimeError) = Result.Failure(command, exception)
|
||||
private fun failure(command: Command, exception: RunError) = Result.Failure(command, exception)
|
||||
|
||||
private var index = 0
|
||||
private val current: String
|
||||
|
||||
Reference in New Issue
Block a user