From 34c106218eaafc76bf19334194bd706586e8cc1d Mon Sep 17 00:00:00 2001 From: Bernhard Messer Date: Thu, 18 Nov 2004 18:37:53 +0000 Subject: [PATCH] make the error messages more verbose using the exceptions toString() method. git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150646 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/lucene/index/SegmentReader.java | 4 ++-- src/java/org/apache/lucene/store/FSDirectory.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/java/org/apache/lucene/index/SegmentReader.java b/src/java/org/apache/lucene/index/SegmentReader.java index 7d69a05fc17..aea1b636f43 100644 --- a/src/java/org/apache/lucene/index/SegmentReader.java +++ b/src/java/org/apache/lucene/index/SegmentReader.java @@ -100,7 +100,7 @@ class SegmentReader extends IndexReader { SegmentReader.class.getName()); IMPL = Class.forName(name); } catch (ClassNotFoundException e) { - throw new RuntimeException("cannot load SegmentReader class: " + e.getMessage()); + throw new RuntimeException("cannot load SegmentReader class: " + e.toString()); } } @@ -123,7 +123,7 @@ class SegmentReader extends IndexReader { try { instance = (SegmentReader)IMPL.newInstance(); } catch (Exception e) { - throw new RuntimeException("cannot load SegmentReader class: " + e.getMessage()); + throw new RuntimeException("cannot load SegmentReader class: " + e.toString()); } instance.init(dir, sis, closeDir, ownDir); instance.initialize(si); diff --git a/src/java/org/apache/lucene/store/FSDirectory.java b/src/java/org/apache/lucene/store/FSDirectory.java index f82ecc28ea9..b5678c0a296 100644 --- a/src/java/org/apache/lucene/store/FSDirectory.java +++ b/src/java/org/apache/lucene/store/FSDirectory.java @@ -65,7 +65,7 @@ public class FSDirectory extends Directory { FSDirectory.class.getName()); IMPL = Class.forName(name); } catch (ClassNotFoundException e) { - throw new RuntimeException("cannot load FSDirectory class: " + e.getMessage()); + throw new RuntimeException("cannot load FSDirectory class: " + e.toString()); } } @@ -115,7 +115,7 @@ public class FSDirectory extends Directory { try { dir = (FSDirectory)IMPL.newInstance(); } catch (Exception e) { - throw new RuntimeException("cannot load FSDirectory class: " + e.getMessage()); + throw new RuntimeException("cannot load FSDirectory class: " + e.toString()); } dir.init(file, create); DIRECTORIES.put(file, dir); @@ -262,14 +262,14 @@ public class FSDirectory extends Directory { try { in.close(); } catch (IOException e) { - throw new RuntimeException("Cannot close input stream: " + e.getMessage()); + throw new RuntimeException("Cannot close input stream: " + e.toString()); } } if (out != null) { try { out.close(); } catch (IOException e) { - throw new RuntimeException("Cannot close output stream: " + e.getMessage()); + throw new RuntimeException("Cannot close output stream: " + e.toString()); } } }