mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
added log to check for errors
This commit is contained in:
parent
6ed13c7afa
commit
47e896f32d
1 changed files with 18 additions and 9 deletions
|
|
@ -202,7 +202,7 @@ class DescriptionEditActivity :
|
||||||
val descriptionEnd =
|
val descriptionEnd =
|
||||||
wikiText!!.substring(
|
wikiText!!.substring(
|
||||||
descriptionStart.length +
|
descriptionStart.length +
|
||||||
descriptionEndIndex,
|
descriptionEndIndex,
|
||||||
)
|
)
|
||||||
buffer.append(descriptionStart)
|
buffer.append(descriptionStart)
|
||||||
for (i in uploadMediaDetails.indices) {
|
for (i in uploadMediaDetails.indices) {
|
||||||
|
|
@ -240,14 +240,23 @@ class DescriptionEditActivity :
|
||||||
applicationContext,
|
applicationContext,
|
||||||
media,
|
media,
|
||||||
updatedWikiText,
|
updatedWikiText,
|
||||||
)?.subscribeOn(Schedulers.io())
|
)?.let { observable -> observable.subscribeOn(Schedulers.io())
|
||||||
?.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
?.subscribe(Consumer<Boolean> { s: Boolean? -> Timber.d("Descriptions are added.") })
|
.subscribe({ success ->
|
||||||
?.let {
|
// Log success status
|
||||||
compositeDisposable.add(
|
Timber.d("Descriptions are added: $success")
|
||||||
it,
|
}, { throwable ->
|
||||||
)
|
// Log any error if occurs
|
||||||
}
|
Timber.e(throwable, "Error adding description.")
|
||||||
|
})?.let { disposable ->
|
||||||
|
// Add to compositeDisposable if the observable is non-null
|
||||||
|
compositeDisposable.add(disposable)
|
||||||
|
}
|
||||||
|
} ?: run {
|
||||||
|
Timber.e("Description addition failed: Observable was null.")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (e: InvalidLoginTokenException) {
|
} catch (e: InvalidLoginTokenException) {
|
||||||
val username: String? = sessionManager.userName
|
val username: String? = sessionManager.userName
|
||||||
val logoutListener =
|
val logoutListener =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue