01: /*
02: * ConverterException.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.util;
13:
14: import workbench.util.SqlUtil;
15:
16: /**
17: * @author support@sql-workbench.net
18: */
19: public class ConverterException extends java.lang.Exception {
20:
21: public ConverterException(String msg) {
22: super (msg);
23: }
24:
25: public ConverterException(Object input, int type, Exception cause) {
26: super ("Could not convert [" + input + "] for datatype "
27: + SqlUtil.getTypeName(type), cause);
28: }
29:
30: public String getLocalizedMessage() {
31: if (this.getCause() == null) {
32: return getMessage();
33: }
34: return getCause().getMessage();
35: }
36: }
|