-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathInvalidRequestException.java
More file actions
64 lines (56 loc) · 1.81 KB
/
Copy pathInvalidRequestException.java
File metadata and controls
64 lines (56 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package com.maxmind.minfraud.exception;
import java.net.URI;
/**
* This class represents a non-specific error returned by MaxMind's minFraud web service. This
* occurs when the web service is up and responding to requests, but the request sent was invalid in
* some way.
*/
public final class InvalidRequestException extends MinFraudException {
private final String code;
private final int httpStatus;
private final URI uri;
/**
* @param message A message explaining the cause of the error.
* @param code The error code returned by the web service.
* @param uri The URL queried.
*/
public InvalidRequestException(String message, String code, URI uri) {
super(message);
this.uri = uri;
this.code = code;
this.httpStatus = 0;
}
/**
* @param message A message explaining the cause of the error.
* @param code The error code returned by the web service.
* @param httpStatus The HTTP status of the response.
* @param uri The URL queried.
* @param e The cause of the exception.
*/
public InvalidRequestException(String message, String code, int httpStatus,
URI uri, Throwable e) {
super(message, e);
this.code = code;
this.uri = uri;
this.httpStatus = httpStatus;
}
/**
* @return The error code returned by the MaxMind web service.
*/
public final String code() {
return code;
}
/**
* @return The integer HTTP status returned by the MaxMind web service. Will be 0 if it was not
* set at throw time.
*/
public final int httpStatus() {
return httpStatus;
}
/**
* @return the URI queried.
*/
public URI uri() {
return this.uri;
}
}