aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/xmpp/exceptions/MissingRequiredElementException.java
blob: de24262f6910c3938468f02fa46e54e7c408cff4 (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
package de.thedevstack.conversationsplus.xmpp.exceptions;

import eu.siacs.conversations.xml.Element;

/**
 *
 */
public class MissingRequiredElementException extends XmppException {
    private String elementName;
    private String namespace;

    public MissingRequiredElementException(String elementName, Element context) {
        super(context);
        this.elementName = elementName;
    }

    public MissingRequiredElementException(String elementName, String namespace, Element context) {
        this(elementName, context);
        this.namespace = namespace;
    }

    @Override
    public String getMessage() {
        return "Missing required element " + ((namespace != null) ? namespace + ":" : "") + elementName + " in context " + getContext();
    }
}