LCOV - code coverage report
Current view: top level - http_parser-4.0.0/lib/src - utils.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 1 7 14.3 %
Date: 2021-11-28 14:37:50 Functions: 0 0 -

          Line data    Source code
       1             : // Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
       2             : // for details. All rights reserved. Use of this source code is governed by a
       3             : // BSD-style license that can be found in the LICENSE file.
       4             : 
       5             : import 'package:source_span/source_span.dart';
       6             : 
       7             : /// Runs [body] and wraps any format exceptions it produces.
       8             : ///
       9             : /// [name] should describe the type of thing being parsed, and [value] should be
      10             : /// its actual value.
      11           5 : T wrapFormatException<T>(String name, String value, T Function() body) {
      12             :   try {
      13             :     return body();
      14           0 :   } on SourceSpanFormatException catch (error) {
      15           0 :     throw SourceSpanFormatException(
      16           0 :         'Invalid $name: ${error.message}', error.span, error.source);
      17           0 :   } on FormatException catch (error) {
      18           0 :     throw FormatException(
      19           0 :         'Invalid $name "$value": ${error.message}', error.source, error.offset);
      20             :   }
      21             : }

Generated by: LCOV version 1.14