How to manage serial port disconnection

Before disconnection it is written "connected" with a green dot below the node.
After it is written "disconnected" with a red dot.
And I have a message in the debug console :

"serial port /dev/port_usb_2 closed unexpectedly"

port_usb_2 is the name I gave to my USB port, instead of ttyUSBx