001/**
002 * Copyright (c) 2014 Digi International Inc.,
003 * All rights not expressly granted are reserved.
004 *
005 * This Source Code Form is subject to the terms of the Mozilla Public
006 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
007 * You can obtain one at http://mozilla.org/MPL/2.0/.
008 *
009 * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
010 * =======================================================================
011 */
012package com.digi.xbee.api.exceptions;
013
014/**
015 * This exception will be thrown when there is an error parsing an API packet
016 * from the input stream.
017 * 
018 * @see CommunicationException
019 */
020public class InvalidPacketException extends CommunicationException {
021
022        // Constants
023        private static final long serialVersionUID = 1L;
024        private static final String DEFAULT_MESSAGE = "The XBee API packet is not properly formed.";
025
026        /**
027         * Creates a {@code InvalidPacketException} with {@value #DEFAULT_MESSAGE} 
028         * as its error detail message.
029         */
030        public InvalidPacketException() {
031                super(DEFAULT_MESSAGE);
032        }
033        
034        /**
035         * Creates a {@code InvalidPacketException} with the specified message.
036         * 
037         * @param message The associated message.
038         */
039        public InvalidPacketException(String message) {
040                super(message);
041        }
042        
043        /**
044         * Creates an {@code InvalidPacketException} with the specified 
045         * message and cause.
046         * 
047         * @param message The associated message.
048         * @param cause The cause of this exception.
049         * 
050         * @see Throwable
051         */
052        public InvalidPacketException(String message, Throwable cause) {
053                super(message, cause);
054        }
055}