Handle more specific BindException and IOException 77/13177/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 27 Nov 2014 20:22:54 +0000 (15:22 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 1 Dec 2014 21:41:25 +0000 (16:41 -0500)
commit594885b1c0800a4e9fb9588ac964b421a1906365
tree68b7a62da6c9db358c5c89c9bf30995e7ef61a4c
parent3e3f54ed3ff69a24f663cf2d3b10e61c49c58ccd
Handle more specific BindException and IOException

It is good pratice to handle specific exceptions rather than using the
catch all generic Exception.

This code change handles the java.net.BindException such that if an port
is already in use we skip creating the simulated device on that port.

IOException will display the failure message and exception and not cause
additional attempts.

Change-Id: I7cbf3aa7016b0589f8fdd3f6476006954068a9a0
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
opendaylight/netconf/netconf-testtool/src/main/java/org/opendaylight/controller/netconf/test/tool/NetconfDeviceSimulator.java