Browse Source

Upgrade dependencies, use new Timber's overloaded method for errors

len 8 years ago
parent
commit
6a30a75e3e

+ 4 - 4
app/build.gradle

@@ -83,7 +83,7 @@ android {
 dependencies {
 
     // Modified dependencies
-    compile 'com.github.inorichi:subsampling-scale-image-view:421fb81'
+    compile 'com.github.inorichi:subsampling-scale-image-view:2d9c854'
     compile 'com.github.inorichi:ReactiveNetwork:69092ed'
 
     // Android support library
@@ -100,7 +100,7 @@ dependencies {
 
     // ReactiveX
     compile 'io.reactivex:rxandroid:1.2.1'
-    compile 'io.reactivex:rxjava:1.1.8'
+    compile 'io.reactivex:rxjava:1.1.10'
     compile 'com.f2prateek.rx.preferences:rx-preferences:1.0.2'
 
     // Network client
@@ -113,7 +113,7 @@ dependencies {
     compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"
 
     // IO
-    compile 'com.squareup.okio:okio:1.9.0'
+    compile 'com.squareup.okio:okio:1.10.0'
 
     // JSON
     compile 'com.google.code.gson:gson:2.7'
@@ -151,7 +151,7 @@ dependencies {
     compile 'com.github.bumptech.glide:okhttp3-integration:1.4.0@aar'
 
     // Logging
-    compile 'com.jakewharton.timber:timber:4.1.2'
+    compile 'com.jakewharton.timber:timber:4.3.0'
 
     // Crash reports
     compile 'ch.acra:acra:4.9.0'

+ 5 - 5
app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadManager.kt

@@ -80,10 +80,10 @@ class DownloadManager(
                     if (areAllDownloadsFinished()) {
                         DownloadService.stop(context)
                     }
-                }, { e ->
+                }, { error ->
                     DownloadService.stop(context)
-                    Timber.e(e, e.message)
-                    downloadNotifier.onError(e.message)
+                    Timber.e(error)
+                    downloadNotifier.onError(error.message)
                 })
 
         if (!isRunning) {
@@ -369,8 +369,8 @@ class DownloadManager(
             try {
                 it.write(gson.toJson(pages).toByteArray())
                 it.flush()
-            } catch (e: Exception) {
-                Timber.e(e, e.message)
+            } catch (error: Exception) {
+                Timber.e(error)
             }
         }
     }

+ 2 - 2
app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdateDownloaderService.kt

@@ -121,8 +121,8 @@ class UpdateDownloaderService : IntentService(UpdateDownloaderService::class.jav
                         UpdateNotificationReceiver.cancelNotificationIntent(ctx))
             }
 
-        } catch (e: Exception) {
-            Timber.e(e, e.message)
+        } catch (error: Exception) {
+            Timber.e(error)
 
             // Prompt the user to retry the download.
             NotificationCompat.Builder(this).update {

+ 3 - 3
app/src/main/java/eu/kanade/tachiyomi/ui/backup/BackupFragment.kt

@@ -121,9 +121,9 @@ class BackupFragment : BaseRxFragment<BackupPresenter>() {
                     .observeOn(AndroidSchedulers.mainThread())
                     .subscribe({
                         presenter.restoreBackup(it)
-                    }, {
-                        context.toast(it.message)
-                        Timber.e(it, it.message)
+                    }, { error ->
+                        context.toast(error.message)
+                        Timber.e(error)
                     })
                     .apply { subscriptions.add(this) }
 

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.kt

@@ -332,7 +332,7 @@ class CatalogueFragment : BaseRxFragment<CataloguePresenter>(), FlexibleViewHold
      */
     fun onAddPageError(error: Throwable) {
         hideProgressBar()
-        Timber.e(error, error.message)
+        Timber.e(error)
 
         catalogue_view.snack(error.message ?: "", Snackbar.LENGTH_INDEFINITE) {
             setAction(R.string.action_retry) {

+ 2 - 2
app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CataloguePresenter.kt

@@ -143,7 +143,7 @@ class CataloguePresenter : BasePresenter<CatalogueFragment>() {
                 .subscribeReplay({ view, page ->
                     view.onAddPage(page.page, page.mangas)
                 }, { view, error ->
-                    Timber.e(error, error.message)
+                    Timber.e(error)
                 })
 
         // Request first page.
@@ -211,7 +211,7 @@ class CataloguePresenter : BasePresenter<CatalogueFragment>() {
                     @Suppress("DEPRECATION")
                     view?.onMangaInitialized(manga)
                 }, { error ->
-                    Timber.e(error, error.message)
+                    Timber.e(error)
                 })
                 .apply { add(this) }
     }

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadPresenter.kt

@@ -35,7 +35,7 @@ class DownloadPresenter : BasePresenter<DownloadFragment>() {
                 .subscribeLatestCache({ view, downloads ->
                     view.onNextDownloads(downloads)
                 }, { view, error ->
-                    Timber.e(error, error.message)
+                    Timber.e(error)
                 })
     }
 

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt

@@ -427,7 +427,7 @@ class LibraryFragment : BaseRxFragment<LibraryPresenter>(), ActionMode.Callback
                     }
                 } catch (error: IOException) {
                     context.toast(R.string.notification_manga_update_failed)
-                    Timber.e(error, error.message)
+                    Timber.e(error)
                 }
             }
 

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersFragment.kt

@@ -376,7 +376,7 @@ class ChaptersFragment : BaseRxFragment<ChaptersPresenter>(), ActionMode.Callbac
 
     fun onChaptersDeletedError(error: Throwable) {
         dismissDeletingDialog()
-        Timber.e(error, error.message)
+        Timber.e(error)
     }
 
     fun dismissDeletingDialog() {

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt

@@ -111,7 +111,7 @@ class ChaptersPresenter : BasePresenter<ChaptersFragment>() {
         startableLatestCache(CHAPTER_STATUS_CHANGES,
                 { getChapterStatusObservable() },
                 { view, download -> view.onChapterStatusChange(download) },
-                { view, error -> Timber.e(error.cause, error.message) })
+                { view, error -> Timber.e(error) })
 
         // Find the active manga from the shared data or return.
         manga = SharedData.get(MangaEvent::class.java)?.manga ?: return

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/manga/myanimelist/MyAnimeListPresenter.kt

@@ -102,7 +102,7 @@ class MyAnimeListPresenter : BasePresenter<MyAnimeListFragment>() {
                     .observeOn(AndroidSchedulers.mainThread())
                     .subscribe({ next -> },
                             { error ->
-                                Timber.e(error, error.message)
+                                Timber.e(error)
                                 // Restart on error to set old values
                                 start(GET_MANGA_SYNC)
                             }))

+ 3 - 3
app/src/main/java/eu/kanade/tachiyomi/ui/reader/ChapterLoader.kt

@@ -42,9 +42,9 @@ class ChapterLoader(
                 .repeat()
                 .subscribeOn(Schedulers.io())
                 .subscribe({
-                }, {
-                    if (it !is InterruptedException) {
-                        Timber.e(it, it.message)
+                }, { error ->
+                    if (error !is InterruptedException) {
+                        Timber.e(error)
                     }
                 })
     }

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt

@@ -213,7 +213,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
     }
 
     fun onChapterError(error: Throwable) {
-        Timber.e(error, error.message)
+        Timber.e(error)
         finish()
         toast(error.message)
     }

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersFragment.kt

@@ -253,7 +253,7 @@ class RecentChaptersFragment
      */
     fun onChaptersDeletedError(error: Throwable) {
         dismissDeletingDialog()
-        Timber.e(error, error.message)
+        Timber.e(error)
     }
 
     /**

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersPresenter.kt

@@ -71,7 +71,7 @@ class RecentChaptersPresenter : BasePresenter<RecentChaptersFragment>() {
                     // Set chapter status
                     view.onChapterStatusChange(download)
                 },
-                { view, error -> Timber.e(error.cause, error.message) }
+                { view, error -> Timber.e(error) }
         )
 
         if (savedState == null) {

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadPresenter.kt

@@ -115,7 +115,7 @@ class RecentlyReadPresenter : BasePresenter<RecentlyReadFragment>() {
                 .subscribeFirst({ view, chapter ->
                     view.onOpenNextChapter(chapter, manga)
                 }, { view, error ->
-                    Timber.e(error, error.message)
+                    Timber.e(error)
                 })
     }
 

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAboutFragment.kt

@@ -133,7 +133,7 @@ class SettingsAboutFragment : SettingsFragment() {
                         }
                     }
                 }, { error ->
-                    Timber.e(error, error.message)
+                    Timber.e(error)
                 })
     }