From 6bc4d3aad1d96eba5b4f1624413d6bd33568aa5e Mon Sep 17 00:00:00 2001 From: pelya Date: Wed, 31 Oct 2012 18:24:33 +0200 Subject: [PATCH] More sensible error message when data download aborted --- project/java/DataDownloader.java | 11 +++++------ project/java/MainActivity.java | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/project/java/DataDownloader.java b/project/java/DataDownloader.java index 43da7fdb0..254fe87a5 100644 --- a/project/java/DataDownloader.java +++ b/project/java/DataDownloader.java @@ -468,7 +468,7 @@ class DataDownloader extends Thread out.close(); out = null; } catch( java.io.IOException e ) { - Status.setText( res.getString(R.string.error_write, path) ); + Status.setText( res.getString(R.string.error_write, path) + ": " + e.getMessage() ); System.out.println("Saving file '" + path + "' - error writing: " + e.toString()); return false; } @@ -571,7 +571,7 @@ class DataDownloader extends Thread out.close(); out = null; } catch( java.io.IOException e ) { - Status.setText( res.getString(R.string.error_write, path) ); + Status.setText( res.getString(R.string.error_write, path) + ": " + e.getMessage() ); System.out.println("Saving file '" + path + "' - error writing or downloading: " + e.toString()); return false; } @@ -594,9 +594,8 @@ class DataDownloader extends Thread " file size in ZIP: " + entry.getSize() + " actual size " + count ); throw new Exception(); } - } catch( Exception e ) - { - Status.setText( res.getString(R.string.error_write, path) ); + } catch( Exception e ) { + Status.setText( res.getString(R.string.error_write, path) + ": " + e.getMessage() ); return false; } System.out.println("Saving file '" + path + "' done"); @@ -613,7 +612,7 @@ class DataDownloader extends Thread } catch( FileNotFoundException e ) { } catch( SecurityException e ) { } catch( java.io.IOException e ) { - Status.setText( res.getString(R.string.error_write, path) ); + Status.setText( res.getString(R.string.error_write, path) + ": " + e.getMessage() ); return false; }; Status.setText( downloadCount + "/" + downloadTotal + ": " + res.getString(R.string.dl_finished) ); diff --git a/project/java/MainActivity.java b/project/java/MainActivity.java index 9c4e7b5d1..a3a29d8f1 100644 --- a/project/java/MainActivity.java +++ b/project/java/MainActivity.java @@ -210,7 +210,7 @@ public class MainActivity extends Activity if( Parent._tv == null ) { Parent._tv = new TextView(Parent); - Parent._tv.setMaxLines(1); + Parent._tv.setMaxLines(2); Parent._tv.setText(R.string.init); Parent._layout2.addView(Parent._tv); }