Skip to content
This repository has been archived by the owner on Jun 16, 2019. It is now read-only.

Commit

Permalink
Add some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
afollestad committed Jun 1, 2018
1 parent 77c45ab commit 6b744eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,13 @@ class ArcticRequest constructor(
.observeToMainThread()
.subscribe(
{
"Request sent successfully!".log(TAG)
resetSelection()
onSent?.invoke(it)
callback?.invoke(it, null)
},
{
"Failed to send the request! ${it.message}".log(TAG)
if (onSendError != null || callback != null) {
onSendError?.invoke(it)
callback?.invoke(0, it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ internal class RealSendInteractor(private val context: Context) : SendInteractor
val archiveFileBody = RequestBody.create(MediaType.parse("multipart/form-data"), zipFile)
val archiveFile = MultipartBody.Part.createFormData("archive", "icons.zip", archiveFileBody)
val appsJson = MultipartBody.Part.createFormData("apps", jsonSb.toString())
"Uploading request to ${config.apiHost}...".log(TAG)
api.performRequest(archiveFile, appsJson)
.flatMap {
if (it.status == "error") {
Expand All @@ -211,10 +212,8 @@ internal class RealSendInteractor(private val context: Context) : SendInteractor
Observable.just(true)
}
}
.doOnNext {
"Request uploaded to the server!".log(TAG)
}
} else {
"Launching share intent...".log(TAG)
launchIntent(zipFile, request.uriTransformer, config, selectedApps)
}
}
Expand Down

0 comments on commit 6b744eb

Please sign in to comment.