return field.get(scope);
} else {
return method.invoke(scope, arguments);
}
} catch (IllegalArgumentException e) {
throw new MustacheException("Error accessing " + getTargetDescription() + " on " + elementToString(scope)
+ ", scope: [" + elementsToString(scopes, scopeIndex) + "]" + ", guards: " + Arrays.toString(guards), e);
} catch (IllegalAccessException e) {
throw new MustacheException("Error accessing " + getTargetDescription() + " on " + elementToString(scope)
+ ", scope: [" + elementsToString(scopes, scopeIndex) + "]" + ", guards: " + Arrays.toString(guards), e);
} catch (InvocationTargetException e) {
throw new MustacheException("Error invoking " + getTargetDescription() + " on " + elementToString(scope), e.getTargetException());
} catch (Exception e) {
throw new MustacheException("Error invoking " + getTargetDescription() + " on " + elementToString(scope), e);
}
}