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

This commit is contained in:
len 2016-09-08 18:30:29 +02:00
parent ccdc336112
commit 6a30a75e3e
17 changed files with 30 additions and 30 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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