How can I simplify a throwing an multiply exceptions in my service in Kotlin?
Have a problem, but can't understand hoe to handle it. I want to throw a specific exception depends on lost argument, but all what i can do:
@Service
class CountryLocalizationServiceImpl (val countryRepository: CountryLocalizationRepository) :
CountryLocalizationService {
override fun getCountryByIsoCode(isoCode: String, language: String): CountryLocalization {
val repository = countryRepository.getCountryByIsoCode(isoCode, language)
if (isoCode != "RU" && isoCode!= "UA") return repository...