diff --git a/vtm-android/src/org/oscim/android/theme/AssetsRenderTheme.java b/vtm-android/src/org/oscim/android/theme/AssetsRenderTheme.java index 9be12478f..41b718b6a 100644 --- a/vtm-android/src/org/oscim/android/theme/AssetsRenderTheme.java +++ b/vtm-android/src/org/oscim/android/theme/AssetsRenderTheme.java @@ -98,7 +98,7 @@ public InputStream getRenderThemeAsStream() throws ThemeException { try { return mAssetManager.open((TextUtils.isEmpty(mRelativePathPrefix) ? "" : mRelativePathPrefix) + mFileName); } catch (IOException e) { - throw new ThemeException(e.getMessage()); + throw new ThemeException(e.getMessage(), e); } } diff --git a/vtm-android/src/org/oscim/android/theme/ContentRenderTheme.java b/vtm-android/src/org/oscim/android/theme/ContentRenderTheme.java index bf11eece2..1c19a1ed3 100644 --- a/vtm-android/src/org/oscim/android/theme/ContentRenderTheme.java +++ b/vtm-android/src/org/oscim/android/theme/ContentRenderTheme.java @@ -88,7 +88,7 @@ public InputStream getRenderThemeAsStream() throws ThemeException { try { return mContentResolver.openInputStream(mUri); } catch (IOException e) { - throw new ThemeException(e.getMessage()); + throw new ThemeException(e.getMessage(), e); } } diff --git a/vtm-web/src/org/oscim/gdx/emu/org/oscim/theme/XmlAtlasThemeBuilder.java b/vtm-web/src/org/oscim/gdx/emu/org/oscim/theme/XmlAtlasThemeBuilder.java index 6eaf241f0..a6bacfc86 100644 --- a/vtm-web/src/org/oscim/gdx/emu/org/oscim/theme/XmlAtlasThemeBuilder.java +++ b/vtm-web/src/org/oscim/gdx/emu/org/oscim/theme/XmlAtlasThemeBuilder.java @@ -58,7 +58,7 @@ public static IRenderTheme read(ThemeFile theme, ThemeCallback themeCallback) th try { new XMLReaderAdapter().parse(renderThemeHandler, theme.getRenderThemeAsStream()); } catch (Exception e) { - throw new ThemeException(e.getMessage()); + throw new ThemeException(e.getMessage(), e); } TextureAtlasUtils.createTextureRegions(renderThemeHandler.bitmapMap, outputMap, atlasList, diff --git a/vtm-web/src/org/oscim/gdx/emu/org/oscim/theme/XmlThemeBuilder.java b/vtm-web/src/org/oscim/gdx/emu/org/oscim/theme/XmlThemeBuilder.java index 8a9be00d5..3914a11c4 100644 --- a/vtm-web/src/org/oscim/gdx/emu/org/oscim/theme/XmlThemeBuilder.java +++ b/vtm-web/src/org/oscim/gdx/emu/org/oscim/theme/XmlThemeBuilder.java @@ -115,7 +115,7 @@ public static IRenderTheme read(ThemeFile theme, ThemeCallback themeCallback) th try { new XMLReaderAdapter().parse(renderThemeHandler, theme.getRenderThemeAsStream()); } catch (Exception e) { - throw new ThemeException(e.getMessage()); + throw new ThemeException(e.getMessage(), e); } return renderThemeHandler.mRenderTheme; @@ -385,9 +385,9 @@ public void startElement(String uri, String localName, String qName, throw new SAXException("unknown element: " + localName); } } catch (SAXException e) { - throw new ThemeException(e.getMessage()); + throw new ThemeException(e.getMessage(), e); } catch (IOException e) { - throw new ThemeException(e.getMessage()); + throw new ThemeException(e.getMessage(), e); } } diff --git a/vtm/src/org/oscim/theme/ExternalRenderTheme.java b/vtm/src/org/oscim/theme/ExternalRenderTheme.java index e1efca288..8e3b44187 100644 --- a/vtm/src/org/oscim/theme/ExternalRenderTheme.java +++ b/vtm/src/org/oscim/theme/ExternalRenderTheme.java @@ -106,7 +106,7 @@ public InputStream getRenderThemeAsStream() throws ThemeException { try { is = new FileInputStream(mPath); } catch (FileNotFoundException e) { - throw new ThemeException(e.getMessage()); + throw new ThemeException(e.getMessage(), e); } return is; } diff --git a/vtm/src/org/oscim/theme/IRenderTheme.java b/vtm/src/org/oscim/theme/IRenderTheme.java index d08c5fdcc..b1dc0a401 100644 --- a/vtm/src/org/oscim/theme/IRenderTheme.java +++ b/vtm/src/org/oscim/theme/IRenderTheme.java @@ -97,8 +97,12 @@ public interface IRenderTheme { Tag transformForwardTag(Tag tag); class ThemeException extends IllegalArgumentException { - public ThemeException(String string) { - super(string); + public ThemeException(String message) { + super(message); + } + + public ThemeException(String message, Throwable cause) { + super(message, cause); } private static final long serialVersionUID = 1L; diff --git a/vtm/src/org/oscim/theme/XmlAtlasThemeBuilder.java b/vtm/src/org/oscim/theme/XmlAtlasThemeBuilder.java index 9b02a26fa..d332eac00 100644 --- a/vtm/src/org/oscim/theme/XmlAtlasThemeBuilder.java +++ b/vtm/src/org/oscim/theme/XmlAtlasThemeBuilder.java @@ -66,7 +66,7 @@ public static IRenderTheme read(ThemeFile theme, ThemeCallback themeCallback) th true, CanvasAdapter.platform == Platform.IOS); return replaceThemeSymbols(renderThemeHandler.mRenderTheme, outputMap); } catch (Exception e) { - throw new ThemeException(e.getMessage()); + throw new ThemeException(e.getMessage(), e); } finally { IOUtils.closeQuietly(inputStream); } diff --git a/vtm/src/org/oscim/theme/XmlThemeBuilder.java b/vtm/src/org/oscim/theme/XmlThemeBuilder.java index 0b97760d4..59636fe7a 100644 --- a/vtm/src/org/oscim/theme/XmlThemeBuilder.java +++ b/vtm/src/org/oscim/theme/XmlThemeBuilder.java @@ -118,7 +118,7 @@ public static IRenderTheme read(ThemeFile theme, ThemeCallback themeCallback) th renderThemeHandler.processRenderTheme(); return renderThemeHandler.mRenderTheme; } catch (Exception e) { - throw new ThemeException(e.getMessage()); + throw new ThemeException(e.getMessage(), e); } finally { IOUtils.closeQuietly(inputStream); } @@ -409,7 +409,7 @@ public void startElement() throws ThemeException { throw new XmlPullParserException("unknown element: " + qName); } } catch (XmlPullParserException | IOException e) { - throw new ThemeException(e.getMessage()); + throw new ThemeException(e.getMessage(), e); } } diff --git a/vtm/src/org/oscim/theme/ZipRenderTheme.java b/vtm/src/org/oscim/theme/ZipRenderTheme.java index ed582e645..28cc07770 100644 --- a/vtm/src/org/oscim/theme/ZipRenderTheme.java +++ b/vtm/src/org/oscim/theme/ZipRenderTheme.java @@ -89,7 +89,7 @@ public InputStream getRenderThemeAsStream() throws ThemeException { try { return mResourceProvider.createInputStream(mRelativePathPrefix, mXmlTheme.substring(mXmlTheme.lastIndexOf("/") + 1)); } catch (IOException e) { - throw new ThemeException(e.getMessage()); + throw new ThemeException(e.getMessage(), e); } }