summaryrefslogtreecommitdiff
path: root/java/client/src/test/java/org/apache/qpid/example/shared/ConnectionException.java
blob: 0ce08fd59dbf48dda4c4d67aca43fc90e0496f7d (plain)
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
package org.apache.qpid.example.shared;

import org.apache.log4j.Logger;

/**
 * Author: Marnie McCormack
 * Date: 18-Jul-2006
 * Time: 11:13:23
 * Copyright JPMorgan Chase 2006
 */
public class ConnectionException extends Exception {

    private int _errorCode;

    public ConnectionException(String message)
    {
        super(message);
    }

    public ConnectionException(String msg, Throwable t)
    {
        super(msg, t);
    }

    public ConnectionException(int errorCode, String msg, Throwable t)
    {
        super(msg + " [error code " + errorCode + ']', t);
        _errorCode = errorCode;
    }

    public ConnectionException(int errorCode, String msg)
    {
        super(msg + " [error code " + errorCode + ']');
        _errorCode = errorCode;
    }

    public ConnectionException(Logger logger, String msg, Throwable t)
    {
        this(msg, t);
        logger.error(getMessage(), this);
    }

    public ConnectionException(Logger logger, String msg)
    {
        this(msg);
        logger.error(getMessage(), this);
    }

    public ConnectionException(Logger logger, int errorCode, String msg)
    {
        this(errorCode, msg);
        logger.error(getMessage(), this);
    }

    public int getErrorCode()
    {
        return _errorCode;
    }
}