01: /*
02: * Created on Mar 18, 2005
03: */
04: package com.sun.portal.wireless.htmlconversion;
05:
06: /**
07: * Standard exception class for this package.
08: *
09: * @author ashwin.mathew@sun.com
10: */
11: public class HtmlConversionException extends Exception {
12:
13: /**
14: * An error occurred while invoking XML APIs.
15: */
16: public static final int XML_ERROR = 1;
17:
18: /**
19: * An error occurred while transforming HTML to AML.
20: */
21: public static final int TRANSFORMATION_ERROR = 2;
22:
23: /**
24: * The URL to scrape is malformed.
25: */
26: public static final int MALFORMED_URL_ERROR = 3;
27:
28: /**
29: * An error occurred while retrieving the URL to scrape.
30: */
31: public static final int URL_RETRIEVAL_ERROR = 4;
32:
33: /**
34: * The content type is unsupported for HTML conversion.
35: */
36: public static final int UNSUPPORTED_CONTENT_TYPE = 5;
37:
38: private int errorCode;
39:
40: public HtmlConversionException(int errorCode, String message) {
41: super (message);
42: this .errorCode = errorCode;
43: }
44:
45: public HtmlConversionException(int errorCode, Throwable rootCause) {
46: super (rootCause);
47: this .errorCode = errorCode;
48: }
49:
50: public int getErrorCode() {
51: return errorCode;
52: }
53:
54: }
|