Output warn log when accessing to the plugin repository failed

This commit is contained in:
Naoki Takezoe
2018-07-17 00:43:33 +09:00
parent b6d5e34980
commit 0366f2f2ed

View File

@@ -2,8 +2,10 @@ package gitbucket.core.plugin
import org.json4s._
import org.apache.commons.io.IOUtils
import org.slf4j.LoggerFactory
object PluginRepository {
private val logger = LoggerFactory.getLogger(getClass)
implicit val formats = DefaultFormats
def parsePluginJson(json: String): Seq[PluginMetadata] = {
@@ -16,7 +18,9 @@ object PluginRepository {
val str = IOUtils.toString(url, "UTF-8")
parsePluginJson(str)
} catch {
case _: Throwable => Nil
case t: Throwable =>
logger.warn("Failed to access to the plugin repository: " + t.toString)
Nil
}
}