throw new RulesException("undefined", "PerformCatchError",
"The table '"+table.stringValue()+"' is undefined");
}catch(RulesException e){
IRSession session = state.getSession();
EntityFactory ef = session.getEntityFactory();
IREntity errorEntity = ef.findRefEntity(error).clone(session).rEntityValue();
state.entitypush(errorEntity);
// If any of the following puts fail (because the given entity doesn't define them), then
// simply carry on your merry way. The user can define these fields if they need them,
// and they don't need to define them if they don't need them.
try { errorEntity.put(null, n("errortype"), p(e.getErrortype())); }catch(RulesException ex){}
try { errorEntity.put(null, n("location"), p(e.getLocation())); }catch(RulesException ex){}
try { errorEntity.put(null, n("message"), p(e.getMessage())); }catch(RulesException ex){}
try { errorEntity.put(null, n("decisionTable"), p(e.getDecisionTable())); }catch(RulesException ex){}
try { errorEntity.put(null, n("formal"), p(e.getErrortype())); }catch(RulesException ex){}
try { errorEntity.put(null, n("postfix"), p(e.getPostfix())); }catch(RulesException ex){}
try { errorEntity.put(null, n("filename"), p(e.getFilename())); }catch(RulesException ex){}
try { errorEntity.put(null, n("section"), p(e.getSection())); }catch(RulesException ex){}
try { errorEntity.put(null, n("number"), RInteger.getRIntegerValue(e.getNumber())); }catch(RulesException ex){}
}
}