handleConditionalFunction method

bool handleConditionalFunction(
  1. String name
)

Handle a conditional function with the given name.

The default implementation returns false if the function fails, and errorHandler is not null.

Implementation

bool handleConditionalFunction(final String name) {
  final f = conditionalFunctions[name];
  if (f == null) {
    throw UnimplementedError('There is no conditional function named $name.');
  }
  try {
    return f(this);
  } on Exception catch (e, s) {
    final f = errorHandler;
    if (f != null) {
      f(e, s);
      return false;
    }
    rethrow;
  }
}