Skip to content

Instantly share code, notes, and snippets.

@juliuscanute
Created July 4, 2019 01:08
Show Gist options
  • Select an option

  • Save juliuscanute/ff6e35970ffe3dee4a0babd6e4f112bc to your computer and use it in GitHub Desktop.

Select an option

Save juliuscanute/ff6e35970ffe3dee4a0babd6e4f112bc to your computer and use it in GitHub Desktop.
Dictionary Controller
class DictionaryController : KoinComponent {
private val repository: RepositoryInterface by inject()
fun getNumberOfPagesInDictionary(): Any {
return try {
repository.getNumberOfPagesInDictionary()
} catch (e: PageRetrievalException) {
ErrorMesssage(message = e.errorMessage, type = ErrorType.PAGE_RETRIVAL_ERROR)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment