bug 622695 - allow android's logger to handle logging exceptions r=mbrubeck a=blocking-fennec

This commit is contained in:
Brad Lassey 2011-01-03 17:34:44 -05:00
parent 83ceb4df00
commit 6757a4b02a
4 changed files with 22 additions and 20 deletions

View File

@ -123,9 +123,11 @@ abstract public class GeckoApp
try {
unpackComponents();
} catch (FileNotFoundException fnfe) {
Log.e("GeckoApp", "error unpacking components", fnfe);
showErrorDialog(getString(R.string.error_loading_file));
return false;
} catch (IOException ie) {
Log.e("GeckoApp", "error unpacking components", ie);
String msg = ie.getMessage();
if (msg.equalsIgnoreCase("No space left on device"))
showErrorDialog(getString(R.string.no_space_to_start_error));
@ -412,7 +414,7 @@ abstract public class GeckoApp
Log.i("GeckoAppJava", intent.toString());
startActivity(intent);
} catch (Exception e) {
Log.i("GeckoAppJava", e.toString());
Log.i("GeckoAppJava", "error doing restart", e);
}
finish();
}
@ -459,7 +461,7 @@ abstract public class GeckoApp
statusCode = 7; // WRITE_ERROR
}
} catch (Exception e) {
Log.i("GeckoAppJava", e.toString());
Log.i("GeckoAppJava", "error launching installer to update", e);
}
// Update the status file
@ -472,7 +474,7 @@ abstract public class GeckoApp
outStream.write(buf, 0, buf.length);
outStream.close();
} catch (Exception e) {
Log.i("GeckoAppJava", e.toString());
Log.i("GeckoAppJava", "error writing status file", e);
}
if (statusCode == 0)
@ -486,7 +488,7 @@ abstract public class GeckoApp
status = reader.readLine();
reader.close();
} catch (Exception e) {
Log.i("GeckoAppJava", e.toString());
Log.i("GeckoAppJava", "error reading update status", e);
}
return status;
}
@ -506,7 +508,7 @@ abstract public class GeckoApp
try {
filePickerResult = mFilePickerResult.take();
} catch (InterruptedException e) {
Log.i("GeckoApp", "error: " + e);
Log.i("GeckoApp", "showing file picker ", e);
}
return filePickerResult;
@ -541,13 +543,13 @@ abstract public class GeckoApp
fos.close();
filePickerResult = file.getAbsolutePath();
}catch (Exception e) {
Log.e("GeckoApp", "error : "+ e);
Log.e("GeckoApp", "showing file picker", e);
}
}
try {
mFilePickerResult.put(filePickerResult);
} catch (InterruptedException e) {
Log.i("GeckoApp", "error: " + e);
Log.i("GeckoApp", "error returning file picker result", e);
}
}
}

View File

@ -1,4 +1,4 @@
/* -*- Mode: Java; tab-width: 20; indent-tabs-mode: nil; -*-
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -109,7 +109,7 @@ public class GeckoInputConnection
try {
mQueryResult.take();
} catch (InterruptedException e) {
Log.e("GeckoAppJava", "IME: deleteSurroundingText interrupted");
Log.e("GeckoAppJava", "IME: deleteSurroundingText interrupted", e);
return false;
}
delStart = mSelectionStart > leftLength ?
@ -194,7 +194,7 @@ public class GeckoInputConnection
try {
text = mQueryResult.take();
} catch (InterruptedException e) {
Log.e("GeckoAppJava", "IME: performContextMenuAction interrupted");
Log.e("GeckoAppJava", "IME: performContextMenuAction interrupted", e);
return false;
}
@ -224,7 +224,7 @@ public class GeckoInputConnection
try {
text = mQueryResult.take();
} catch (InterruptedException e) {
Log.e("GeckoAppJava", "IME: performContextMenuAction interrupted");
Log.e("GeckoAppJava", "IME: performContextMenuAction interrupted", e);
return false;
}
}
@ -251,7 +251,7 @@ public class GeckoInputConnection
try {
mQueryResult.take();
} catch (InterruptedException e) {
Log.e("GeckoAppJava", "IME: getExtractedText interrupted");
Log.e("GeckoAppJava", "IME: getExtractedText interrupted", e);
return null;
}
extract.selectionStart = mSelectionStart;
@ -268,7 +268,7 @@ public class GeckoInputConnection
return extract;
} catch (InterruptedException e) {
Log.e("GeckoAppJava", "IME: getExtractedText interrupted");
Log.e("GeckoAppJava", "IME: getExtractedText interrupted", e);
return null;
}
}
@ -282,7 +282,7 @@ public class GeckoInputConnection
try {
mQueryResult.take();
} catch (InterruptedException e) {
Log.e("GeckoAppJava", "IME: getTextBefore/AfterCursor interrupted");
Log.e("GeckoAppJava", "IME: getTextBefore/AfterCursor interrupted", e);
return null;
}
@ -305,7 +305,7 @@ public class GeckoInputConnection
try {
return mQueryResult.take();
} catch (InterruptedException e) {
Log.e("GeckoAppJava", "IME: getTextBefore/AfterCursor: Interrupted!");
Log.e("GeckoAppJava", "IME: getTextBefore/AfterCursor: Interrupted!", e);
return null;
}
}
@ -331,7 +331,7 @@ public class GeckoInputConnection
try {
mQueryResult.take();
} catch (InterruptedException e) {
Log.e("GeckoAppJava", "IME: setComposingText interrupted");
Log.e("GeckoAppJava", "IME: setComposingText interrupted", e);
return false;
}
// Make sure we are in a composition

View File

@ -175,7 +175,7 @@ class GeckoSurfaceView
try {
bb = mSyncBuf.take();
} catch (InterruptedException ie) {
Log.e("GeckoAppJava", "Threw exception while getting sync buf: " + ie);
Log.e("GeckoAppJava", "Threw exception while getting sync buf: ", ie);
}
if (bb != null && bb.capacity() == (width * height * 2)) {
mSoftwareBitmap = Bitmap.createBitmap(mWidth, mHeight, Bitmap.Config.RGB_565);
@ -289,7 +289,7 @@ class GeckoSurfaceView
try {
mSyncBuf.put(buffer);
} catch (InterruptedException ie) {
Log.e("GeckoAppJava", "Threw exception while getting sync buf: " + ie);
Log.e("GeckoAppJava", "Threw exception while getting sync buf: ", ie);
}
return;
}

View File

@ -1,4 +1,4 @@
/* -*- Mode: Java; tab-width: 20; indent-tabs-mode: nil; -*-
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -94,7 +94,7 @@ public class NotificationHandler
try {
context.startActivity(appIntent);
} catch (ActivityNotFoundException e) {
Log.e("GeckoAppJava", "NotificationHandler Exception: " + e.getMessage());
Log.e("GeckoAppJava", "NotificationHandler Exception: ", e);
}
}
}