mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Handle task exceptions.
This commit is contained in:
parent
cc7d5d29c6
commit
2d2ede3656
1 changed files with 5 additions and 2 deletions
|
@ -4,7 +4,6 @@ import com.beust.kobalt.api.*
|
||||||
import com.beust.kobalt.api.annotation.Task
|
import com.beust.kobalt.api.annotation.Task
|
||||||
import com.beust.kobalt.internal.PluginInfo
|
import com.beust.kobalt.internal.PluginInfo
|
||||||
import com.beust.kobalt.internal.TaskManager
|
import com.beust.kobalt.internal.TaskManager
|
||||||
import com.beust.kobalt.TaskResult
|
|
||||||
import com.beust.kobalt.maven.DepFactory
|
import com.beust.kobalt.maven.DepFactory
|
||||||
import com.beust.kobalt.maven.IClasspathDependency
|
import com.beust.kobalt.maven.IClasspathDependency
|
||||||
import com.beust.kobalt.maven.KobaltException
|
import com.beust.kobalt.maven.KobaltException
|
||||||
|
@ -101,7 +100,11 @@ public class Plugins @Inject constructor (val taskManagerProvider : Provider<Tas
|
||||||
|
|
||||||
fun toTask(m: Method, project: Project, plugin: IPlugin): (Project) -> TaskResult {
|
fun toTask(m: Method, project: Project, plugin: IPlugin): (Project) -> TaskResult {
|
||||||
val result: (Project) -> TaskResult = {
|
val result: (Project) -> TaskResult = {
|
||||||
m.invoke(plugin, project) as TaskResult
|
try {
|
||||||
|
m.invoke(plugin, project) as TaskResult
|
||||||
|
} catch(ex: Throwable) {
|
||||||
|
throw KobaltException("Error while invoking task $m on plugin $plugin")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue