1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 09:47:13 +00:00

File not found is an expected exception

This commit is contained in:
M66B 2018-12-16 15:50:50 +01:00
parent 8ad36cf5e3
commit 9b135be19c

View file

@ -79,6 +79,7 @@ import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@ -879,7 +880,11 @@ public class FragmentCompose extends FragmentEx {
@Override
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
// External app sending absolute file
if (ex instanceof FileNotFoundException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
else
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
}.load(this, args);
}
@ -1491,7 +1496,11 @@ public class FragmentCompose extends FragmentEx {
@Override
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
// External app sending absolute file
if (ex instanceof FileNotFoundException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
else
Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex);
}
};