Handle more specific BindException and IOException
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)
commitcd0539514fd164b59ef5c19948dfb99643aa0643
tree6a2e17463efc79b446c25142912ee6574192fd16
parentb5141b561c671f6b8cf7e73e6fefe038e0d2032e
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