T wrapFormatException()

in lib/src/utils.dart [11:21]


T wrapFormatException<T>(String name, String value, T Function() body) {
  try {
    return body();
  } on SourceSpanFormatException catch (error) {
    throw SourceSpanFormatException(
        'Invalid $name: ${error.message}', error.span, error.source);
  } on FormatException catch (error) {
    throw FormatException(
        'Invalid $name "$value": ${error.message}', error.source, error.offset);
  }
}