001/**
002 *
003 * Copyright the original author or authors
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.jivesoftware.smackx.jingle;
018
019
020import org.jivesoftware.smack.XMPPException;
021import org.jivesoftware.smackx.jingle.packet.JingleError;
022
023   /**
024     * A Jingle exception.
025     *
026     * @author Alvaro Saurin <alvaro.saurin@gmail.com>
027     */
028    public class JingleException extends XMPPException {
029        private static final long serialVersionUID = -1521230401958103382L;
030        
031                private final JingleError error;
032
033        /**
034         * Default constructor.
035         */
036        public JingleException() {
037            super();
038            error = null;
039        }
040
041        /**
042         * Constructor with an error message.
043         *
044         * @param msg The message.
045         */
046        public JingleException(String msg) {
047            super(msg);
048            error = null;
049        }
050
051        /**
052         * Constructor with an error response.
053         *
054         * @param error The error message.
055         */
056        public JingleException(JingleError error) {
057            super();
058            this.error = error;
059        }
060
061        /**
062         * Return the error message.
063         *
064         * @return the error
065         */
066        public JingleError getError() {
067            return error;
068        }
069    }