]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/engine/HtmlEntry.java
Add text to all RuntimeExceptions.
[Dictionary.git] / src / com / hughes / android / dictionary / engine / HtmlEntry.java
index 4d7b534cff0ef115a4e8ed08df00943ed55ea5a1..f5ea520992e5521e1e810f781432a2edbc677514 100644 (file)
@@ -246,7 +246,7 @@ public class HtmlEntry extends AbstractEntry implements Comparable<HtmlEntry> {
                 try {
                     html = new String(data.get(index), "UTF-8");
                 } catch (UnsupportedEncodingException e) {
-                    throw new RuntimeException(e);
+                    throw new RuntimeException("Dictionary HTML data corrupted", e);
                 }
                 htmlRef = new SoftReference<String>(html);
                 return html;
@@ -259,14 +259,14 @@ public class HtmlEntry extends AbstractEntry implements Comparable<HtmlEntry> {
                     raf.seek(offset);
                     raf.read(zipBytes);
                 } catch (IOException e) {
-                    throw new RuntimeException(e);
+                    throw new RuntimeException("Failed to read HTML data from dictionary", e);
                 }
             }
             try {
                 final byte[] bytes = StringUtil.unzipFully(zipBytes, numBytes);
                 html = new String(bytes, "UTF-8");
             } catch (IOException e) {
-                throw new RuntimeException(e);
+                throw new RuntimeException("Dictionary HTML data corrupted", e);
             }
             htmlRef = new SoftReference<String>(html);
             return html;