Skip to main content
summaryrefslogtreecommitdiffstats
blob: b6df10b8d8866cf778bfe519af7005896a116da6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*******************************************************************************
 * Copyright (c) 2003, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.j2ee.internal.web.operations;



import java.io.IOException;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.JavaModelException;
import org.xml.sax.SAXException;


/**
 * The WebToolingException class is the generic class for exceptions generated by the web tooling.
 */
public class WebToolingException extends Exception {
	public static final String SAX_ERROR_MESSAGE = ProjectSupportResourceHandler.Operation_failed_due_to_SA_ERROR_; //$NON-NLS-1$ = "Operation failed due to SAX error: "
	public static final String IO_ERROR_MESSAGE = ProjectSupportResourceHandler.Operation_failed_due_to_IO_ERROR_; //$NON-NLS-1$ = "Operation failed due to IO error: "
	public static final String CORE_ERROR_MESSAGE = ProjectSupportResourceHandler.Operation_failed_due_to_Co_ERROR_; //$NON-NLS-1$ = "Operation failed due to Core error: "
	public static final String JAVA_MODEL_ERROR_MESSAGE = ProjectSupportResourceHandler.Operation_failed_due_to_Ja_ERROR_; //$NON-NLS-1$ = "Operation failed due to Java Model error: "

	/**
	 * Create a new WebToolingException with no message.
	 */
	public WebToolingException() {
		super();
	}

	/**
	 * Create a new instance of the receiver for a supplied IO Exception
	 * 
	 * @param message
	 *            java.lang.String
	 */
	public WebToolingException(IOException exception) {
		this(IO_ERROR_MESSAGE, exception);
	}

	/**
	 * Create a new WebToolingException with error message of s.
	 * 
	 * @param s
	 *            java.lang.String
	 */
	public WebToolingException(String s) {
		super(s);
	}

	/**
	 * Create a new instance of the receiver with the supplied preamble and the message of the
	 * example appended to the end.
	 * 
	 * @param message
	 *            java.lang.String
	 */
	public WebToolingException(String preamble, Throwable exception) {
		this(preamble + exception.getMessage());
	}

	/**
	 * Create a new instance of the receiver for a supplied CoreException
	 * 
	 * @param exception
	 *            CoreException
	 */
	public WebToolingException(CoreException exception) {
		this(CORE_ERROR_MESSAGE, exception);
	}

	/**
	 * Create a new instance of the receiver for a supplied JavaModelException.
	 * 
	 * @param exception
	 *            JavaModelException
	 */
	public WebToolingException(JavaModelException exception) {
		this(JAVA_MODEL_ERROR_MESSAGE, exception);
	}

	/**
	 * Create a new instance of the receiver for a supplied SAX Exception
	 * 
	 * @param exception
	 *            SAXException
	 */
	public WebToolingException(SAXException exception) {
		this(SAX_ERROR_MESSAGE, exception);
	}
}

Back to the top