catchAll method

void catchAll(
  1. dynamic onError(
    1. Object error
    )
)

Implementation

void catchAll(Function(Object error) onError) {
  try {
    this();
  } catch (e) {
    onError(e);
  }
}