call<T> static method

T call<T>(
  1. String op,
  2. T run()
)

Runs run for operation op, rethrows BuError/CryptoException, wraps the rest in CryptoException.

Implementation

static T call<T>(String op, T Function() run) {
  try {
    return run();
  } on BuError {
    rethrow;
  } catch (e) {
    throw CoreErrors.cryptoFailed(op, reason: e.toString());
  }
}