Improve error logging: #153
This commit is contained in:
parent
695f83e19e
commit
39c7a853c8
|
@ -196,8 +196,7 @@ public class DebugActivity extends Activity {
|
||||||
File destFile = helper.exportDB(dbHandler.getHelper(), dir);
|
File destFile = helper.exportDB(dbHandler.getHelper(), dir);
|
||||||
GB.toast(this, "Exported to: " + destFile.getAbsolutePath(), Toast.LENGTH_LONG, GB.INFO);
|
GB.toast(this, "Exported to: " + destFile.getAbsolutePath(), Toast.LENGTH_LONG, GB.INFO);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
LOG.error("Unable to export db", ex);
|
GB.toast(this, "Error exporting DB: " + ex.getMessage(), Toast.LENGTH_LONG, GB.ERROR, ex);
|
||||||
Toast.makeText(this, "Error exporting DB: " + ex.getMessage(), Toast.LENGTH_LONG).show();
|
|
||||||
} finally {
|
} finally {
|
||||||
if (dbHandler != null) {
|
if (dbHandler != null) {
|
||||||
dbHandler.release();
|
dbHandler.release();
|
||||||
|
@ -217,7 +216,7 @@ public class DebugActivity extends Activity {
|
||||||
helper.validateDB(sqLiteOpenHelper);
|
helper.validateDB(sqLiteOpenHelper);
|
||||||
GB.toast(this, "Import successful.", Toast.LENGTH_LONG, GB.INFO);
|
GB.toast(this, "Import successful.", Toast.LENGTH_LONG, GB.INFO);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
GB.toast(this, "Error importing DB: " + ex.getMessage(), Toast.LENGTH_LONG, GB.ERROR);
|
GB.toast(this, "Error importing DB: " + ex.getMessage(), Toast.LENGTH_LONG, GB.ERROR, ex);
|
||||||
} finally {
|
} finally {
|
||||||
if (dbHandler != null) {
|
if (dbHandler != null) {
|
||||||
dbHandler.release();
|
dbHandler.release();
|
||||||
|
|
Loading…
Reference in New Issue