Small improvement

pull/198/head
M66B 4 years ago
parent 4651fff05e
commit 9189afe909

@ -22,6 +22,7 @@ package eu.faircode.email;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri;
import android.system.ErrnoException;
import android.text.TextUtils;
import androidx.core.net.MailTo;
@ -107,6 +108,8 @@ import javax.mail.internet.ParseException;
import biweekly.Biweekly;
import biweekly.ICalendar;
import static android.system.OsConstants.ENOSPC;
public class MessageHelper {
private boolean ensuredEnvelope = false;
private boolean ensuredHeaders = false;
@ -866,7 +869,8 @@ public class MessageHelper {
MessageHelper(MimeMessage message, Context context) throws IOException {
long cake = Helper.getAvailableStorageSpace();
if (cake < Helper.MIN_REQUIRED_SPACE)
throw new IOException(context.getString(R.string.app_cake));
throw new IOException(context.getString(R.string.app_cake),
new ErrnoException(context.getPackageName(), ENOSPC));
if (cacheDir == null)
cacheDir = context.getCacheDir();
this.imessage = message;

Loading…
Cancel
Save