Repository navigation
Switch Jmol interaction to use MMTF - #570
Conversation
| } | ||
| }).start(); | ||
| viewer.openReader(null, in); | ||
| } catch (IOException e) { |
There was a problem hiding this comment.
How about throwing the exception? In the end of the day this will only produce a blank jmol screen (and a message in the logs), but a user will not be able to know if there was a problem in the loading. If we throw it then a user can catch it down the line and act upon it.
There was a problem hiding this comment.
The problem is that the interesting exception is the one from writeToOutputStream, and that has to run in its own thread if I want to use pipes like this, so it can't throw an exception.
The other IOExceptions would indicate a broken pipe to Jmol, which would very likely be from program termination anyways. Trying to throw an IOException here requires adding the exception to maybe a dozen other functions that call this, some of which don't make much sense.
I guess I could write the MMTF to a byte[] and then pass it to jmol (avoiding creating a new thread).
I guess ultimately I caught the exceptions here because they seemed very unlikely to result from user input (assuming the MMTF encoder doesn't have bugs).
There was a problem hiding this comment.
Thanks for the explanation, that makes sense now.
I guess ultimately I caught the exceptions here because they seemed very unlikely to result from user input (assuming the MMTF encoder doesn't have bugs).
Well in theory if the structure is "malformed" in some way the encoder should throw an exception saying it doesn't like it. In real life I'm not sure if such a "malformation" is a possibility.
|
Nice thanks a lot! This would finally solve #201 right? |
MMTF write support is much better than mmCIF. I'm assuming it will be faster as well.