summaryrefslogtreecommitdiff
path: root/sources/scalac/ApplicationError.java
blob: 5c00567d5018ccc927940dc993ccd97992664107 (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
/*     ____ ____  ____ ____  ______                                     *\
**    / __// __ \/ __// __ \/ ____/    SOcos COmpiles Scala             **
**  __\_ \/ /_/ / /__/ /_/ /\_ \       (c) 2002, LAMP/EPFL              **
** /_____/\____/\___/\____/____/                                        **
**                                                                      **
** $Id$
\*                                                                      */

package scalac;

import scalac.util.Debug;

public class ApplicationError extends Error {

    //########################################################################
    // Private interface

    private static String combine(String message, Object object) {
        String string = Debug.show(object);
        return message == null ? string : message + ": " + string;
    }

    //########################################################################
    // ApplicationError constructors

    public ApplicationError() {
        this((String)null, (Throwable)null);
    }

    public ApplicationError(String message) {
        this(message, (Throwable)null);
    }

    public ApplicationError(Object object) {
        this(null, object, null);
    }

    public ApplicationError(Throwable cause) {
        this((String)null, cause);
    }

    public ApplicationError(String message, Object object) {
        this(message, object, null);
    }

    public ApplicationError(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicationError(Object object, Throwable cause) {
        this(null, object, cause);
    }

    public ApplicationError(String message, Object object, Throwable cause) {
        this(combine(message, object), cause);
    }

    //########################################################################
}