Skip to content

Commit b143557

Browse files
committed
Throw APIException on reloadDatabase fail
1 parent a68f619 commit b143557

File tree

1 file changed

+5
-1
lines changed
  • src/main/kotlin/com/github/azurapi/azurapikotlin/api

1 file changed

+5
-1
lines changed

src/main/kotlin/com/github/azurapi/azurapikotlin/api/Atago.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ object Atago {
8080
* Reload database from remote json
8181
*/
8282
fun reloadDatabase() {
83-
database.loadDatabase()
83+
try {
84+
database.loadDatabase()
85+
} catch (e: Exception) {
86+
throw ApiException("Could not reload database because: ${e.message}")
87+
}
8488
}
8589
}

0 commit comments

Comments
 (0)