File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/main/java/org/observabilitystack/geoip/web Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import java .beans .PropertyEditorSupport ;
4
4
5
+ import org .slf4j .Logger ;
6
+ import org .slf4j .LoggerFactory ;
7
+
5
8
import com .google .common .net .InetAddresses ;
6
9
7
10
import static com .google .common .base .Preconditions .checkNotNull ;
8
11
9
12
public class InetAdressPropertyEditor extends PropertyEditorSupport {
10
13
14
+ private final Logger logger = LoggerFactory .getLogger (getClass ());
15
+
11
16
@ Override
12
17
public void setAsText (String text ) {
13
18
checkNotNull (text , "Pre-condition violated: text must not be null." );
14
19
15
20
try {
16
21
setValue (InetAddresses .forString (text ));
17
22
} catch (IllegalArgumentException e ) {
18
- throw new InvalidIpAddressException (e .getMessage ());
23
+ logger .info ("Invalid IP address given: {}" , e .getMessage ());
24
+ throw new InvalidIpAddressException ("Invalid IP address given" );
19
25
}
20
26
}
21
27
}
You can’t perform that action at this time.
0 commit comments