When do new XXXPhidget(); openAny(); throw exception?

Supporting Java SE version 7 and up
Posts: 8
Joined: Sat Nov 16, 2013 8:35 am

When do new XXXPhidget(); openAny(); throw exception?

Postby Soroush » Thu Dec 12, 2013 4:50 am


I wonder why the statements like

XXXPhidget xxxp = new XXXPhidget();

throw PhidgetException. When might it happen. I see that they don't throw any exception even when the phidget isn't connected, so when should I be concerned about them.

When an exception happens the program should suggest a solution. In fact if I want to initialize them lazily in a Singleton, these exceptions frighten me, because I have no idea when they may occur, so I can't suggest a solution to the program. I assume that exception throwing is dummy and I leave the except block empty. Can be any preoccupation in this case? or they may occur one day when the library changes?

Now I'm using only InterfaceKitPhidget & EncoderPhidget.

Return to “Java”

Who is online

Users browsing this forum: No registered users and 1 guest