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!!)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue