Catch network exceptions (UnknownHostException etc.)

This commit is contained in:
Andreas Jaggi
2018-07-15 08:09:31 +02:00
parent 18a0c6c92a
commit 79aa55f741

View File

@@ -11,9 +11,13 @@ object PluginRepository {
}
def getPlugins(): Seq[PluginMetadata] = {
val url = new java.net.URL("https://plugins.gitbucket-community.org/releases/plugins.json")
val str = IOUtils.toString(url, "UTF-8")
parsePluginJson(str)
try {
val url = new java.net.URL("https://plugins.gitbucket-community.org/releases/plugins.json")
val str = IOUtils.toString(url, "UTF-8")
parsePluginJson(str)
} catch {
case _: Throwable => Nil
}
}
}