You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have a DelegateCommand that does not run in background and my Action throws an exception I only get the log message "Exception in Command Execution" and no further information.
This is because of the lines in DelegateCommand.java:
privatevoidcallActionAndSynthesizeServiceRun() {
try {
getStateObjectPropertyReadable().setValue(State.SCHEDULED);
// We call the User Action. If an exception occurs we save it, therefore we can use it in the Test// (createSynthesizedTask) to throw it during the Service invocation.actionSupplier.get().action();
getStateObjectPropertyReadable().setValue(State.SUCCEEDED);
} catch (Exceptione) {
LOG.error("Exception in Command Execution", occuredException);
this.occuredException = e;
getStateObjectPropertyReadable().setValue(State.FAILED);
}
}
The field "occuredException" is logged before it is initialized. Also I cannot use the "getException()" method of the Service interface to get the Throwable object, so I have no information about the problem.
The text was updated successfully, but these errors were encountered:
At first we have to fix the log statement so that the correct exception appears in the logs.
After that we have to provide the exception to the user. Maybe we should change the occurredException from a basic field to a ObjectProperty<Exception> and provide getter/setter/property-accessors. This would be similar to the getException method from Service.
@AKreisel Do you think this would be a suitable way of handling the exception or do you have other ideas for the API to handle exceptions?
@sialcasa can you please have a look at this issue. Is there any argument against introducing a exception property for the user?
@lestard On the first view we would have to implement it like the stateProperty because the exceptionProperty is already provided by the extended Service in the DelegateCommand.
/**
* For internal purposes we need to change the state property of the service.
*/
private ObjectProperty<State> getStateObjectPropertyReadable() {
return (ObjectProperty<State>) stateProperty();
}
If I have a DelegateCommand that does not run in background and my Action throws an exception I only get the log message "Exception in Command Execution" and no further information.
This is because of the lines in DelegateCommand.java:
The field "occuredException" is logged before it is initialized. Also I cannot use the "getException()" method of the Service interface to get the Throwable object, so I have no information about the problem.
The text was updated successfully, but these errors were encountered: