source: protocol/src/main/java/geniusweb/protocol/ProtocolException.java@ 32

Last change on this file since 32 was 32, checked in by bart, 3 years ago

Multiple learns with repeated tournament, maven use https.

File size: 1.4 KB
Line 
1package geniusweb.protocol;
2
3import geniusweb.actions.PartyId;
4import geniusweb.references.PartyRef;
5
6/**
7 * thrown if a Party violates the protocols (that includes disconnecting).
8 */
9public class ProtocolException extends Exception {
10 private static final long serialVersionUID = 4618901784366523980L;
11 private PartyId party; // the failing party
12
13 /**
14 * @param message the error message
15 * @param party offending party, either the {@link PartyId} or a
16 * {@link PartyRef}
17 */
18 public ProtocolException(String message, PartyId party) {
19 this(message, party, null);
20 }
21
22 /**
23 * ProtocolException is special, in that it does not auto-fill the
24 * stacktrace. This is needed because usually a ProtocolException is caused
25 * by a party doing a bad action. Creating a stacktrace pointing to the
26 * class reporting the protocol exception (usually, the protocol handler)
27 * makes no sense as the protocol handler is doing the correct job there.
28 *
29 *
30 * @param message the error message
31 * @param party offending {@link PartyId}
32 * @param e the cause of the error
33 */
34 public ProtocolException(String message, PartyId party, Throwable e) {
35 super(party + ":" + message, e, true, false);
36 this.party = party;
37 }
38
39 /**
40 *
41 * @return offending party, either the {@link PartyId} or a {@link PartyRef}
42 */
43 public PartyId getParty() {
44 return party;
45 }
46
47}
Note: See TracBrowser for help on using the repository browser.