All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.wulkanowy.sdk.scrapper.repository.SymbolRepository.kt Maven / Gradle / Ivy

Go to download

Unified way of retrieving data from the UONET+ register through mobile api and scraping api

There is a newer version: 2.7.0
Show newest version
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