01: /*
02: * $RCSfile: VAIBuilderException.java,v $
03: * @modification $Date: 2001/09/28 19:41:42 $
04: * @version $Id: VAIBuilderException.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
05: *
06: */
07:
08: package com.memoire.vainstall.builder.util;
09:
10: /**
11: * This exception class wraps an Exception and is
12: * able to return its message as formatted HTML.
13: *
14: * @see java.lang.Exception
15: *
16: * @author Henrik Falk
17: * @version $Id: VAIBuilderException.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
18: */
19: public class VAIBuilderException extends Exception {
20:
21: private String title = "";
22: private String shortMessage = "";
23: private String longMessage = "";
24:
25: public VAIBuilderException(String title, String shortMessage,
26: String longMessage) {
27: super (shortMessage);
28: this .title = title;
29: this .shortMessage = shortMessage;
30: this .longMessage = longMessage;
31: }
32:
33: public String getMessageAsHtml() {
34:
35: String out = "<html><b><font color=black size=2><left>";
36: out += title + " :<br>";
37: out += "<font color=red size=2>" + shortMessage
38: + "</font><br><br>";
39: if (longMessage != null) {
40: out += longMessage;
41: }
42: out += "</left></font></b></html>";
43:
44: return out;
45: }
46:
47: }
|