guard<T> function

T guard<T>(
  1. MapperMethod method,
  2. String hint,
  3. T fn()
)

Implementation

T guard<T>(MapperMethod method, String hint, T Function() fn) {
  try {
    return fn();
  } catch (e) {
    throw MapperException.chain(method, hint, e);
  }
}