Skip to content

Show useful error messages #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ class AppsInteractorImpl(
APPS_DIR_NAME
)
if (!(directory.exists() || directory.mkdirs())) {
emitter.onError(IOException("unable to create directory"))
emitter.onError(IOException("unable to create directory " + directory.name))
return@create
}
val destination = File(directory, getApkName(entity))
if (destination.exists() && !destination.delete()) {
emitter.onError(IOException("unable to delete destination file"))
emitter.onError(IOException("unable to delete destination file " + destination.name))
return@create
}
val buffer = ByteArray(524288)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class AppsPresenterImpl(
.subscribe({ file ->
router?.shareApk(file)
}, {
view?.showAppExportError()
view?.showAppExportError(it.message.toString())
})
}

Expand All @@ -202,7 +202,7 @@ class AppsPresenterImpl(
.subscribe({ file ->
view?.showExtractSuccess(file.path)
}, {
view?.showAppExportError()
view?.showAppExportError(it.message.toString())
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface AppsView {

fun showAppLaunchError()

fun showAppExportError()
fun showAppExportError(msg: String)

fun showNoRequestedPermissionsMessage()

Expand Down Expand Up @@ -183,8 +183,8 @@ class AppsViewImpl(
Snackbar.make(recycler, R.string.non_launchable_package, Snackbar.LENGTH_LONG).show()
}

override fun showAppExportError() {
Snackbar.make(recycler, R.string.app_extract_failed, Snackbar.LENGTH_LONG).show()
override fun showAppExportError(msg: String) {
Snackbar.make(recycler, msg, Snackbar.LENGTH_LONG).show()
}

override fun showNoRequestedPermissionsMessage() {
Expand Down