Skip to content

Commit e74f504

Browse files
committed
defined IPGeolocationError to throw when an error response is received or invalid values are provided for a query
1 parent 7a9a7af commit e74f504

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package io.ipgeolocation.api.exceptions;
2+
3+
public class IPGeolocationError extends RuntimeException {
4+
private int status = -1;
5+
6+
public IPGeolocationError(Throwable e) {
7+
super(e);
8+
}
9+
10+
public IPGeolocationError(String message) {
11+
super(message);
12+
}
13+
14+
public IPGeolocationError(int status, String message) {
15+
super(message);
16+
17+
this.status = status;
18+
}
19+
20+
public int getStatus() {
21+
return status;
22+
}
23+
}

0 commit comments

Comments
 (0)