Object r = null;
try {
r = m.invoke(bshInstance, new Object[] { s, o });
} catch (IllegalArgumentException e) { // Programming error
log.error("Error invoking bsh method " + m.getName() + "\n", e);
throw new JMeterError("Error invoking bsh method " + m.getName(), e);
} catch (IllegalAccessException e) { // Also programming error
log.error("Error invoking bsh method " + m.getName() + "\n", e);
throw new JMeterError("Error invoking bsh method " + m.getName(), e);
} catch (InvocationTargetException e) { // Can occur at run-time
// could be caused by the bsh Exceptions:
// EvalError, ParseException or TargetError
log.error("Error invoking bsh method " + m.getName() + "\n", e);
throw new JMeterException("Error invoking bsh method " + m.getName(), e);