01: package pygmy.core;
02:
03: import java.net.ProtocolException;
04:
05: public class HttpProtocolException extends ProtocolException {
06: int statusCode;
07:
08: public HttpProtocolException(int statusCode, String message) {
09: super (message);
10: this .statusCode = statusCode;
11: }
12:
13: public int getStatusCode() {
14: return statusCode;
15: }
16:
17: public String getStatusPhrase() {
18: return Http.getStatusPhrase(statusCode);
19: }
20:
21: public String toString() {
22: return getClass().getName() + ": " + statusCode + " "
23: + getMessage();
24: }
25: }
|