Daemon: do not exit with internal error on invalid arguments

Invalid compiler arguments should lead to a compilation error, not
internal error. This has been fixed by splitting the
"parseArguments(...)" call (which does parsing + validation) in
CompileServiceImpl into two calls of parseCommandLineArguments +
validateArguments, and returning with a compilation error if the latter
did not succeed

 #KT-16057 Fixed
 #KT-14848 In Progress
This commit is contained in:
Alexander Udalov
2017-04-21 13:51:41 +03:00
parent 2cad64881d
commit a67382fdec
5 changed files with 23 additions and 67 deletions
@@ -49,7 +49,7 @@ data class ArgumentParseErrors(
var argumentWithoutValue: String? = null
)
// Parses arguments in the passed [result] object, or throws an [IllegalArgumentException] with the message to be displayed to the user
// Parses arguments into the passed [result] object. Errors related to the parsing will be collected into [CommonToolArguments.errors].
fun <A : CommonToolArguments> parseCommandLineArguments(args: Array<out String>, result: A) {
data class ArgumentField(val field: Field, val argument: Argument)