bug:3338089 print better error msg in DownloadThread when exception occurs
Vasu Nori [Mon, 10 Jan 2011 23:01:49 +0000 (15:01 -0800)]
when download thread gets an exception and aborts a download, print
the stacktrace of the exception - so one can debug the problem.

Change-Id: Iab1bae3b6180d8601e84020453ff35815ae3e69f

src/com/android/providers/downloads/DownloadThread.java

index fefbe1d..8b8d8bd 100644 (file)
@@ -180,11 +180,8 @@ public class DownloadThread extends Thread {
             // fall through to finally block
         } catch (Throwable ex) { //sometimes the socket code throws unchecked exceptions
             errorMsg = "Exception for id " + mInfo.mId + ": " + ex.getMessage();
-            Log.w(Constants.TAG, errorMsg);
+            Log.w(Constants.TAG, errorMsg, ex);
             finalStatus = Downloads.Impl.STATUS_UNKNOWN_ERROR;
-            if (Constants.LOGV) {
-                Log.w(Constants.TAG, errorMsg, ex);
-            }
             // falls through to the code that reports an error
         } finally {
             if (wakeLock != null) {