update error handle
This commit is contained in:
@@ -16,7 +16,8 @@ private const val LOG_TAG = "NETWORK_DEBUG"
|
||||
@AndroidEntryPoint
|
||||
class MainActivity : ComponentActivity() {
|
||||
|
||||
@Inject lateinit var getScheduleUseCase: GetScheduleUseCase
|
||||
@Inject
|
||||
lateinit var getScheduleUseCase: GetScheduleUseCase
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -29,8 +30,9 @@ class MainActivity : ComponentActivity() {
|
||||
val src = if (result.refreshedFromNetwork) "NETWORK" else "CACHE"
|
||||
Log.d(LOG_TAG, "FROM $src: ${result.data}")
|
||||
}
|
||||
|
||||
is DataResult.Error -> {
|
||||
Log.e(LOG_TAG, "ERROR", result.throwable)
|
||||
Log.e(LOG_TAG, "ERROR: $result")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,13 +12,13 @@ import javax.inject.Singleton
|
||||
@InstallIn(SingletonComponent::class)
|
||||
object AppConfigModule {
|
||||
|
||||
private const val BASE_PROD_URL = "https://tulsu.ru/schedule/queries/"
|
||||
private const val BASE_DEVELOP_URL = "https://tulsu.ru/schedule/queries/"
|
||||
private const val BASE_URL_PROD = "https://tulsu.ru/schedule/queries/"
|
||||
private const val BASE_URL_DEVELOP = "https://scherbatykh.ru/app/tsudesk/"
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideAppConfig(): AppConfig {
|
||||
val baseUrl = if (BuildConfig.DEBUG) BASE_DEVELOP_URL else BASE_PROD_URL
|
||||
val baseUrl = if (BuildConfig.DEBUG) BASE_URL_DEVELOP else BASE_URL_PROD
|
||||
return AppConfig(
|
||||
isDebug = BuildConfig.DEBUG,
|
||||
baseUrl = baseUrl,
|
||||
|
||||
Reference in New Issue
Block a user