mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-31 06:15:48 +00:00
Catch IOException
This commit is contained in:
@@ -495,16 +495,12 @@ public class GitActivity extends AppCompatActivity {
|
|||||||
//This is what happens when jgit fails :(
|
//This is what happens when jgit fails :(
|
||||||
//TODO Handle the diffent cases of exceptions
|
//TODO Handle the diffent cases of exceptions
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
new AlertDialog.Builder(GitActivity.this).
|
new AlertDialog.Builder(GitActivity.this).setMessage(e.getMessage()).show();
|
||||||
setMessage(e.getMessage()).
|
|
||||||
show();
|
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
//TODO Handle the exception correctly if we are unable to delete the directory...
|
//TODO Handle the exception correctly if we are unable to delete the directory...
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
new AlertDialog.Builder(GitActivity.this).
|
new AlertDialog.Builder(GitActivity.this).setMessage(e.getMessage()).show();
|
||||||
setMessage(e.getMessage()).
|
|
||||||
show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
@@ -523,7 +519,12 @@ public class GitActivity extends AppCompatActivity {
|
|||||||
try {
|
try {
|
||||||
// Silently delete & replace the lone .git folder if it exists
|
// Silently delete & replace the lone .git folder if it exists
|
||||||
if (localDir.listFiles().length == 1 && localDir.listFiles()[0].getName().equals(".git")) {
|
if (localDir.listFiles().length == 1 && localDir.listFiles()[0].getName().equals(".git")) {
|
||||||
FileUtils.deleteDirectory(localDir);
|
try {
|
||||||
|
FileUtils.deleteDirectory(localDir);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
new AlertDialog.Builder(GitActivity.this).setMessage(e.getMessage()).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
new CloneOperation(localDir, activity)
|
new CloneOperation(localDir, activity)
|
||||||
.setCommand(hostname)
|
.setCommand(hostname)
|
||||||
@@ -532,9 +533,7 @@ public class GitActivity extends AppCompatActivity {
|
|||||||
//This is what happens when jgit fails :(
|
//This is what happens when jgit fails :(
|
||||||
//TODO Handle the diffent cases of exceptions
|
//TODO Handle the diffent cases of exceptions
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
new AlertDialog.Builder(this).
|
new AlertDialog.Builder(this).setMessage(e.getMessage()).show();
|
||||||
setMessage(e.getMessage()).
|
|
||||||
show();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user