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
This commit is contained in:
Bernhard Messer 2004-11-18 18:37:53 +00:00
parent fc6694ef9d
commit 34c106218e
2 changed files with 6 additions and 6 deletions

View File

@ -100,7 +100,7 @@ class SegmentReader extends IndexReader {
SegmentReader.class.getName()); SegmentReader.class.getName());
IMPL = Class.forName(name); IMPL = Class.forName(name);
} catch (ClassNotFoundException e) { } 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 { try {
instance = (SegmentReader)IMPL.newInstance(); instance = (SegmentReader)IMPL.newInstance();
} catch (Exception e) { } 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.init(dir, sis, closeDir, ownDir);
instance.initialize(si); instance.initialize(si);

View File

@ -65,7 +65,7 @@ public class FSDirectory extends Directory {
FSDirectory.class.getName()); FSDirectory.class.getName());
IMPL = Class.forName(name); IMPL = Class.forName(name);
} catch (ClassNotFoundException e) { } 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 { try {
dir = (FSDirectory)IMPL.newInstance(); dir = (FSDirectory)IMPL.newInstance();
} catch (Exception e) { } 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); dir.init(file, create);
DIRECTORIES.put(file, dir); DIRECTORIES.put(file, dir);
@ -262,14 +262,14 @@ public class FSDirectory extends Directory {
try { try {
in.close(); in.close();
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException("Cannot close input stream: " + e.getMessage()); throw new RuntimeException("Cannot close input stream: " + e.toString());
} }
} }
if (out != null) { if (out != null) {
try { try {
out.close(); out.close();
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException("Cannot close output stream: " + e.getMessage()); throw new RuntimeException("Cannot close output stream: " + e.toString());
} }
} }
} }