mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +01:00
Return error from method channel
This commit is contained in:
parent
22b607f89c
commit
02ff3a0d70
1 changed files with 6 additions and 2 deletions
|
@ -34,8 +34,12 @@ class MediaStoreChannelHandler(activity: Activity)
|
|||
|
||||
override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
|
||||
if (call.method == "saveFileToDownload") {
|
||||
saveFileToDownload(call.argument<String>("fileName")!!,
|
||||
call.argument<ByteArray>("content")!!, result)
|
||||
try {
|
||||
saveFileToDownload(call.argument<String>("fileName")!!,
|
||||
call.argument<ByteArray>("content")!!, result)
|
||||
} catch (e: Throwable) {
|
||||
result.error("systemException", e.message, null)
|
||||
}
|
||||
} else {
|
||||
result.notImplemented()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue