Improved error message

pull/174/head
M66B 5 years ago
parent 5870856402
commit 7a456b9cdd

@ -418,7 +418,7 @@ public class FragmentBase extends Fragment {
name = Long.toString(attachment.id); name = Long.toString(attachment.id);
DocumentFile document = tree.createFile(attachment.type, name); DocumentFile document = tree.createFile(attachment.type, name);
if (document == null) if (document == null)
throw new FileNotFoundException(uri + ":" + name); throw new FileNotFoundException("Could not save " + uri + ":" + name);
ParcelFileDescriptor pfd = null; ParcelFileDescriptor pfd = null;
OutputStream os = null; OutputStream os = null;
@ -470,7 +470,10 @@ public class FragmentBase extends Fragment {
return; return;
} }
Log.unexpectedError(getParentFragmentManager(), ex); if (ex instanceof FileNotFoundException)
ToastEx.makeText(getContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
} }
}.execute(this, args, "attachments:save"); }.execute(this, args, "attachments:save");
} }

Loading…
Cancel
Save