1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.net.telnet;
17
18 /***
19 * The InvalidTelnetOptionException is the exception that is
20 * thrown whenever a TelnetOptionHandler with an invlaid
21 * option code is registered in TelnetClient with addOptionHandler.
22 * <p>
23 * @author Bruno D'Avanzo
24 ***/
25 public class InvalidTelnetOptionException extends Exception
26 {
27
28 /***
29 * Option code
30 ***/
31 private int optionCode = -1;
32
33 /***
34 * Error message
35 ***/
36 private String msg;
37
38 /***
39 * Constructor for the exception.
40 * <p>
41 * @param message - Error message.
42 * @param optcode - Option code.
43 ***/
44 public InvalidTelnetOptionException(String message, int optcode)
45 {
46 optionCode = optcode;
47 msg = message;
48 }
49
50 /***
51 * Gets the error message of ths exception.
52 * <p>
53 * @return the error message.
54 ***/
55 public String getMessage()
56 {
57 return (msg + ": " + optionCode);
58 }
59 }