io.github.wulkanowy.sdk.scrapper.repository.SymbolRepository.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-scrapper Show documentation
Show all versions of sdk-scrapper Show documentation
Unified way of retrieving data from the UONET+ register through mobile api and scraping api
package io.github.wulkanowy.sdk.scrapper.repository
import io.github.wulkanowy.sdk.scrapper.login.InvalidSymbolException
import io.github.wulkanowy.sdk.scrapper.service.SymbolService
internal class SymbolRepository(
private val symbolService: SymbolService,
) {
suspend fun isSymbolNotExist(symbol: String): Boolean {
val res = runCatching { symbolService.getSymbolPage(symbol) }
when (res.exceptionOrNull()) {
is InvalidSymbolException -> return true
else -> res.getOrThrow()
}
// can't tell
return false
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy