cacth all exceptions in MensaParser

there are many things that can go wrong
This commit is contained in:
Jannik 2019-05-25 20:23:31 +02:00
parent e804774970
commit 9efc7fe4b7
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
4 changed files with 6 additions and 2 deletions

View File

@ -38,4 +38,4 @@ compileTestKotlin {
} }
group 'org.mosad' group 'org.mosad'
version '1.0.2' version '1.1.1'

View File

@ -50,7 +50,7 @@ class APIController {
var logger: Logger = LoggerFactory.getLogger(APIController::class.java) var logger: Logger = LoggerFactory.getLogger(APIController::class.java)
private var requestCount = 0 private var requestCount = 0
private val startTime = System.currentTimeMillis() / 1000 private val startTime = System.currentTimeMillis() / 1000
private val softwareVersion = "1.1.0" private val softwareVersion = "1.1.1"
private val apiVersion = "1.1.0" private val apiVersion = "1.1.0"
// hso parser links (hardcoded) // hso parser links (hardcoded)

View File

@ -50,6 +50,8 @@ class CourseListParser {
} }
} catch (ex: SocketTimeoutException) { } catch (ex: SocketTimeoutException) {
logger.warn("timeout from hs-offenburg.de, updating on next attempt!") logger.warn("timeout from hs-offenburg.de, updating on next attempt!")
} catch (gex: Exception) {
logger.error("general CourseListParser error", gex)
} }
return courseLinkList return courseLinkList

View File

@ -57,6 +57,8 @@ class MensaParser {
} }
} catch (ex: SocketTimeoutException) { } catch (ex: SocketTimeoutException) {
logger.warn("timeout from $menuLink, updating on next attempt!") logger.warn("timeout from $menuLink, updating on next attempt!")
} catch (gex: Exception) {
logger.error("general MensaParser error", gex)
} }
return mealWeekList return mealWeekList