File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
android/capacitor/src/main/java/com/getcapacitor/plugin Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -579,23 +579,22 @@ private void _copy(PluginCall call, boolean doRename) {
579
579
toObject .delete ();
580
580
581
581
assert fromObject != null ;
582
- boolean modified = false ;
583
582
584
583
if (doRename ) {
585
- modified = fromObject .renameTo (toObject );
584
+ boolean modified = fromObject .renameTo (toObject );
585
+ if (!modified ) {
586
+ call .error ("Unable to rename, unknown reason" );
587
+ return ;
588
+ }
586
589
} else {
587
590
try {
588
591
copyRecursively (fromObject , toObject );
589
- modified = true ;
590
- } catch (IOException ignored ) {
592
+ } catch (IOException e ) {
593
+ call .error ("Unable to perform action: " + e .getLocalizedMessage ());
594
+ return ;
591
595
}
592
596
}
593
597
594
- if (!modified ) {
595
- call .error ("Unable to perform action, unknown reason" );
596
- return ;
597
- }
598
-
599
598
call .success ();
600
599
}
601
600
You can’t perform that action at this time.
0 commit comments