Commit | Line | Data |
---|---|---|
5255c030 VP |
1 | /******************************************************************************* |
2 | * Copyright (c) 2014 Ericsson | |
3 | * | |
4 | * All rights reserved. This program and the accompanying materials are | |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * Vincent Perot - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
93d1d135 | 13 | package org.eclipse.linuxtools.internal.pcap.core.packet; |
5255c030 VP |
14 | |
15 | /** | |
16 | * Exception that is thrown when Packet is erroneous. This is different than an | |
17 | * invalid packet. An invalid packet contains bad fields (such as bad checksum) | |
18 | * and does not throw exceptions while an erroneous packet is a packet that is | |
19 | * impossible to obtain. For instance, an erroneous packet can be smaller than | |
20 | * the minimum required size. Erroneous packets throw BadPacketExceptions. | |
21 | * | |
22 | * @author Vincent Perot | |
23 | */ | |
24 | public class BadPacketException extends Exception { | |
25 | ||
26 | private static final long serialVersionUID = 7071588720009577619L; | |
27 | ||
28 | /** | |
29 | * Default constructor with no message. | |
30 | */ | |
31 | public BadPacketException() { | |
32 | super(); | |
33 | } | |
34 | ||
35 | /** | |
36 | * Constructor with an attached message. | |
37 | * | |
38 | * @param message | |
39 | * The message attached to this exception | |
40 | */ | |
41 | public BadPacketException(String message) { | |
42 | super(message); | |
43 | } | |
44 | ||
45 | /** | |
46 | * Re-throw an exception into this type. | |
47 | * | |
48 | * @param e | |
49 | * The previous Exception we caught | |
50 | */ | |
51 | public BadPacketException(Exception e) { | |
52 | super(e); | |
53 | } | |
54 | ||
55 | /** | |
56 | * Constructor with an attached message and re-throw an exception into this | |
57 | * type. | |
58 | * | |
59 | * @param message | |
60 | * The message attached to this exception | |
61 | * @param exception | |
62 | * The previous Exception caught | |
63 | */ | |
64 | public BadPacketException(String message, Throwable exception) { | |
65 | super(message, exception); | |
66 | } | |
67 | ||
68 | } |