Skip to content

Commit 27d42d4

Browse files
committed
Add error logging for oneDriveClient.drive(token)
1 parent dc2b2e0 commit 27d42d4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/kotlin/com/andrzejressel/onedrivecollector/bean/PrometheusCollectorBean.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ class PrometheusCollectorBean(
3030

3131
val accountDrives = accounts.associateWith { account ->
3232
val token = "Bearer ${account.accessToken}"
33-
val driveInfo = oneDriveClient.drive(token)
34-
driveInfo
33+
try {
34+
oneDriveClient.drive(token)
35+
} catch (e: Exception) {
36+
logger.error("Cannot get drive [${account.name}]", e)
37+
throw RuntimeException("Cannot get drive [${account.name}]", e)
38+
}
3539
}
3640

3741
return listOf(

0 commit comments

Comments
 (0)