Added simple error if node cannot do a action due to ProductTypeOperation restrictions

This commit is contained in:
Daniel Poustka 2020-12-27 12:22:59 +01:00
parent e25879bcb6
commit 59246406a6
2 changed files with 11 additions and 5 deletions

View File

@ -164,7 +164,7 @@ public class NodeBase implements ChannelObserver {
* @param action type of product operation to do
* @param product product to proceed
*/
public void doAction(ProductOperationType action, Product product)
public void doAction(ProductOperationType action, Product product) throws IllegalCallerException
{
if(action.getNode().equals(this.nodeType))
new Action(this, product, action);

View File

@ -22,6 +22,8 @@ public class DoActionStep extends ScenarioStep {
@Override
void execute() {
//todo maybe do a better error handling
try {
if (product != null) {
nodeBase.doAction(productOperationType, product);
}
@ -29,4 +31,8 @@ public class DoActionStep extends ScenarioStep {
nodeBase.doAction(productOperationType);
}
}
catch (IllegalCallerException e) {
System.err.println(e.getMessage());
}
}
}