Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Side by Side Diff: lib/src/utils.dart

Issue 1950183003: Remove deprecated APIs. (Closed) Base URL: git@github.com:dart-lang/http_parser@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/scan.dart ('k') | lib/src/web_socket.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:source_span/source_span.dart'; 5 import 'package:source_span/source_span.dart';
6 6
7 /// Runs [body] and wraps any format exceptions it produces. 7 /// Runs [body] and wraps any format exceptions it produces.
8 /// 8 ///
9 /// [name] should describe the type of thing being parsed, and [value] should be 9 /// [name] should describe the type of thing being parsed, and [value] should be
10 /// its actual value. 10 /// its actual value.
11 wrapFormatException(String name, String value, body()) { 11 /*=T*/ wrapFormatException/*<T>*/(String name, String value, /*=T*/ body()) {
12 try { 12 try {
13 return body(); 13 return body();
14 } on SourceSpanFormatException catch (error) { 14 } on SourceSpanFormatException catch (error) {
15 throw new SourceSpanFormatException( 15 throw new SourceSpanFormatException(
16 'Invalid $name: ${error.message}', error.span, error.source); 16 'Invalid $name: ${error.message}', error.span, error.source);
17 } on FormatException catch (error) { 17 } on FormatException catch (error) {
18 throw new FormatException( 18 throw new FormatException(
19 'Invalid $name "$value": ${error.message}', 19 'Invalid $name "$value": ${error.message}',
20 error.source, 20 error.source,
21 error.offset); 21 error.offset);
22 } 22 }
23 } 23 }
OLDNEW
« no previous file with comments | « lib/src/scan.dart ('k') | lib/src/web_socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698