Search the FirstSpirit Knowledge Base
Dear Community,
it's really a pity that the following interface:
does not offer a proper exception handling in the following methods:
Up to now, only:
might be thrown due to the lack of the "throws" clause in the upper methods. But even RuntimeException do not lead to a GUI feedback. So, the administrator does not now, whether the module installation process passed successfully or not.
That's really bad. Or is there an alternative available??
What type of exception do you expect in the throws clause of the mentioned methods? If you have some 'expected' exceptions in your implementation why should FirstSpirit handle them?
Runtime exceptions thrown in one of the methods should display a dialog in the client. And the trace should then appear in the log dialog.
Hi Peter,
I would expect something like a custom:
in the throws clause of the methods. This would allow informing the clients when an exception occurred.
When RuntimeExceptions are thrown, actually nothing happens . In case of IllegalStateExceptions for instance, no dialog appears in the AdminClient. We just observed a GUI feedback in case of a NullPointerException.
I just build a module throwing an IllegalStateException in the methods mentioned above. I see the exceptions are logged and an error dialog popping up in the admin client, so everything is ok here. I tested with a current build, but should be the same with the released build (4.2.454 as time of writing).
Dear Peter,
with the following code enclosed, we tried to provoke an upcoming dialog box showing an exception during a project component installation run within the FirstSpirit Server and project configuration client:
@Override
public void installed() {
UserService service = getProject().getUserService();
TemplateStoreRoot templateStore = service.getTemplateStore();
/*
* path separator in ZIP files (here: bosch.fsm) is always a slash:
* independent of the OS!!!
*/
try {
importPackage(FILES + "/" + GROUP_SCRIPT_EXPORT,
templateStore.getScripts(), "imports.xml");
} catch (ElementDeletedException e) {
throw new IllegalStateException(e.getMessage());
} catch (WorkflowLockException e) {
throw new IllegalStateException(e.getMessage());
} catch (IOException e) {
throw new IllegalStateException(e.getMessage());
} catch (LockException e) {
throw new IllegalStateException(e.getMessage());
}
}
The problem: nothing happened. Did we implement it in the wrong manner?
Hi Holger,
sorry but my tests are too long ago. I cannot remember my code
I'll check again when I've got some spare time.
Until then: Against which FirstSpirit version did you check your code?
--Peter
Hi Peter,
against FirstSpirit FS 4.2 R4 468. The important thing: here, it is a FirstSpirit project component installation that should handle the unchecked RuntimeExceptions here.