Ecdar / Ecdar-GUI

A graphical tool for modeling using ECDAR (Environment for Compositional Design and Analysis of Real Time Systems)
MIT License
3 stars 5 forks source link

Handle exceptions individually on connection close #144

Closed Nielswps closed 1 year ago

Nielswps commented 1 year ago

When connections are closed, they can potentially throw an IOException. This is currently just passed on to the surrounding method, but it could potentially leave any connections further down the list open.

The issue is here: https://github.com/Ecdar/Ecdar-GUI/blob/052b6201f043f08bee7f53e98143ebfdc7f5c91a/src/main/java/ecdar/backend/BackendDriver.java#L61

We should consider encapsulating each call to close() in a try/catch, as mentioned by @Brandhoej

_Originally posted by @Brandhoej in https://github.com/Ecdar/Ecdar-GUI/pull/136#discussion_r1122780672_

Nielswps commented 1 year ago

The mentioned method never actually throws an IOException. The potential exception is caught within the BackendConnection.close() method as shown here:

https://github.com/Ecdar/Ecdar-GUI/blob/052b6201f043f08bee7f53e98143ebfdc7f5c91a/src/main/java/ecdar/backend/BackendConnection.java#L47-L56

I am currently working on a minor refactoring of the BackendDriver, which will remove the

... throws IOException

from the method mentioned in the issue