From 13b74d0d9e4f308ddb515ef5f39e2af0441d5131 Mon Sep 17 00:00:00 2001 From: cketti Date: Sun, 9 Oct 2011 01:14:59 +0200 Subject: [PATCH] Added error logging --- src/com/fsck/k9/preferences/StorageExporter.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/com/fsck/k9/preferences/StorageExporter.java b/src/com/fsck/k9/preferences/StorageExporter.java index b9de982e7..47c47c13c 100644 --- a/src/com/fsck/k9/preferences/StorageExporter.java +++ b/src/com/fsck/k9/preferences/StorageExporter.java @@ -81,14 +81,15 @@ public class StorageExporter { throws StorageImportExportException { OutputStream os = null; + String filename = null; try { File dir = new File(Environment.getExternalStorageDirectory() + File.separator + context.getPackageName()); dir.mkdirs(); File file = Utility.createUniqueFile(dir, EXPORT_FILENAME); - String fileName = file.getAbsolutePath(); - os = new FileOutputStream(fileName); + filename = file.getAbsolutePath(); + os = new FileOutputStream(filename); if (encryptionKey == null) { exportPreferences(context, os, includeGlobals, accountUuids); @@ -98,14 +99,16 @@ public class StorageExporter { } // If all went well, we return the name of the file just written. - return fileName; + return filename; } catch (Exception e) { throw new StorageImportExportException(e); } finally { if (os != null) { try { os.close(); - } catch (IOException ioe) {} + } catch (IOException ioe) { + Log.w(K9.LOG_TAG, "Couldn't close exported settings file: " + filename); + } } } }