marlonlom
07/11/2021, 5:22 PMsuspend fun findBook (isbn: String): Flow <Result <BookDetailApiResponse>> = flow {
val apiResult: Result <BookDetailApiResponse> = try {
val foundBook = bookStoreApi.getBookDetail (isbn)
if (foundBook.error == "0") Result.success (foundBook)
else Result.failure (Exception (errorMessage))
} catch (exception: Exception) {
Result.failure (Exception (errorMessage, exception))
}
emit (apiResult)
}
In StackOverflow I put the concern, pos already went beyond the flow <T> function that I created, since in the error trace it does not indicate anything but the internal compiler.
https://stackoverflow.com/.../android-studio-error-while...
Thanks in advance.