mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
Temporary fix for kotlinc 1.1.
This commit is contained in:
parent
9fb3eb87a2
commit
6ac1260e8b
9 changed files with 33 additions and 11 deletions
|
@ -102,7 +102,7 @@ class ConsoleTransferListener @JvmOverloads constructor(out: PrintStream? = null
|
|||
|
||||
if (event.exception !is MetadataNotFoundException) {
|
||||
if (KobaltLogger.LOG_LEVEL > 2) {
|
||||
event.exception.printStackTrace(out)
|
||||
Exceptions.printStackTrace(event.exception)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ class ConsoleTransferListener @JvmOverloads constructor(out: PrintStream? = null
|
|||
}
|
||||
|
||||
override fun transferCorrupted(event: TransferEvent?) {
|
||||
event!!.exception.printStackTrace(out)
|
||||
Exceptions.printStackTrace(event!!.exception)
|
||||
}
|
||||
|
||||
protected fun toKB(bytes: Long): Long {
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package com.beust.kobalt.maven.aether
|
||||
|
||||
object Exceptions {
|
||||
fun printStackTrace(t: Throwable) {
|
||||
t.printStackTrace(System.out)
|
||||
|
||||
// println("PRINT STACK TRACE FOR $t")
|
||||
// t.printStackTrace(System.out)
|
||||
// println(t.message)
|
||||
// t.stackTrace.forEach {
|
||||
// println(" " + it)
|
||||
// }
|
||||
}
|
||||
}
|
|
@ -27,7 +27,7 @@ object ManualRepositorySystemFactory {
|
|||
|
||||
locator.setErrorHandler(object : DefaultServiceLocator.ErrorHandler() {
|
||||
override fun serviceCreationFailed(type: Class<*>, impl: Class<*>, exception: Throwable) {
|
||||
exception.printStackTrace()
|
||||
Exceptions.printStackTrace(exception)
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.beust.kobalt.KobaltException
|
|||
import com.beust.kobalt.internal.DocUrl
|
||||
import com.beust.kobalt.internal.KobaltSettings
|
||||
import com.beust.kobalt.maven.Http
|
||||
import com.beust.kobalt.maven.aether.Exceptions
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.google.inject.Inject
|
||||
|
@ -132,7 +133,7 @@ class GithubApi2 @Inject constructor(
|
|||
}
|
||||
} catch(e: Exception) {
|
||||
kobaltLog(1, "Couldn't retrieve releases from github: " + e.message)
|
||||
e.printStackTrace()
|
||||
Exceptions.printStackTrace(e)
|
||||
// val error = parseRetrofitError(e)
|
||||
// val details = if (error.errors != null) {
|
||||
// error.errors[0]
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.beust.kobalt.Args
|
|||
import com.beust.kobalt.AsciiArt
|
||||
import com.beust.kobalt.KobaltException
|
||||
import com.beust.kobalt.api.Kobalt
|
||||
import com.beust.kobalt.maven.aether.Exceptions
|
||||
import java.time.LocalDateTime
|
||||
import java.time.format.DateTimeFormatter
|
||||
|
||||
|
@ -81,7 +82,9 @@ class Logger(val dev: Boolean) {
|
|||
|
||||
println(AsciiArt.errorColor(getPattern("E", shortMessage, longMessage, tag)))
|
||||
if (KobaltLogger.LOG_LEVEL > 1) {
|
||||
e?.printStackTrace()
|
||||
val t = e as Throwable
|
||||
Exceptions.printStackTrace(t)
|
||||
// e?.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,7 +92,7 @@ class Logger(val dev: Boolean) {
|
|||
val fullMessage = "***** WARNING " + (e?.message ?: message)
|
||||
println(AsciiArt.Companion.warnColor(getPattern("W", fullMessage, fullMessage, tag)))
|
||||
if (KobaltLogger.LOG_LEVEL > 1) {
|
||||
e?.printStackTrace()
|
||||
Exceptions.printStackTrace(e!!)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.beust.kobalt.api.Kobalt
|
|||
import com.beust.kobalt.app.ProjectFinder
|
||||
import com.beust.kobalt.internal.build.BuildFile
|
||||
import com.beust.kobalt.internal.eventbus.ArtifactDownloadedEvent
|
||||
import com.beust.kobalt.maven.aether.Exceptions
|
||||
import com.google.common.eventbus.EventBus
|
||||
import com.google.common.eventbus.Subscribe
|
||||
import com.google.gson.Gson
|
||||
|
@ -28,7 +29,7 @@ class GetDependencyGraphHandler : WebSocketListener {
|
|||
}
|
||||
|
||||
override fun onWebSocketError(cause: Throwable?) {
|
||||
cause?.printStackTrace()
|
||||
Exceptions.printStackTrace(cause)
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
|
@ -72,7 +73,7 @@ class GetDependencyGraphHandler : WebSocketListener {
|
|||
}
|
||||
}, useGraph = true)
|
||||
} catch(ex: Throwable) {
|
||||
ex.printStackTrace()
|
||||
Exceptions.printStackTrace(ex)
|
||||
val errorMessage = ex.stackTrace.map { it.toString() }.joinToString("\n<p>")
|
||||
DependencyData.GetDependenciesData(errorMessage = errorMessage)
|
||||
} finally {
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.beust.kobalt.api.Kobalt
|
|||
import com.beust.kobalt.app.MainModule
|
||||
import com.beust.kobalt.homeDir
|
||||
import com.beust.kobalt.internal.KobaltSettings
|
||||
import com.beust.kobalt.maven.aether.Exceptions
|
||||
import com.beust.kobalt.misc.KFiles
|
||||
import com.beust.kobalt.misc.kobaltLog
|
||||
import com.beust.kobalt.misc.warn
|
||||
|
@ -71,7 +72,7 @@ class KobaltWebSocketClient : Runnable {
|
|||
}
|
||||
|
||||
override fun onFailure(ex: IOException, response: Response?) {
|
||||
ex.printStackTrace()
|
||||
Exceptions.printStackTrace(ex)
|
||||
error("WebSocket failure: ${ex.message} response: $response")
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.beust.kobalt.app.remote
|
|||
import com.beust.kobalt.api.Project
|
||||
import com.beust.kobalt.homeDir
|
||||
import com.beust.kobalt.internal.PluginInfo
|
||||
import com.beust.kobalt.maven.aether.Exceptions
|
||||
import com.beust.kobalt.misc.KFiles
|
||||
import com.beust.kobalt.misc.kobaltLog
|
||||
import com.google.inject.Inject
|
||||
|
@ -56,7 +57,7 @@ class KobaltServer @Inject constructor(@Assisted val force: Boolean, @Assisted @
|
|||
// WasabiServer(initCallback, cleanUpCallback).run(port)
|
||||
}
|
||||
} catch(ex: Exception) {
|
||||
ex.printStackTrace()
|
||||
Exceptions.printStackTrace(ex)
|
||||
} finally {
|
||||
// deleteServerFile()
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.beust.kobalt.app.Templates
|
|||
import com.beust.kobalt.internal.PluginInfo
|
||||
import com.beust.kobalt.internal.build.BuildFile
|
||||
import com.beust.kobalt.internal.eventbus.ArtifactDownloadedEvent
|
||||
import com.beust.kobalt.maven.aether.Exceptions
|
||||
import com.google.common.collect.ListMultimap
|
||||
import com.google.common.eventbus.EventBus
|
||||
import com.google.common.eventbus.Subscribe
|
||||
|
@ -110,7 +111,7 @@ class GetDependenciesHandler : WebSocketListener {
|
|||
}
|
||||
|
||||
override fun onWebSocketError(cause: Throwable?) {
|
||||
cause?.printStackTrace()
|
||||
Exceptions.printStackTrace(cause)
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue