Improved error message

This commit is contained in:
M66B 2020-02-14 18:10:22 +01:00
parent 5870856402
commit 7a456b9cdd
1 changed files with 5 additions and 2 deletions

View File

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