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

Side by Side Diff: pkg/front_end/lib/src/fasta/problems.dart

Issue 2979623002: Use messages for (some) public API errors (Closed)
Patch Set: cl comments Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 library fasta.problems; 5 library fasta.problems;
6 6
7 import 'messages.dart' 7 import 'messages.dart'
8 show 8 show
9 Message, 9 Message,
10 deprecated_format, 10 deprecated_format,
(...skipping 16 matching lines...) Expand all
27 if (message.tip != null) { 27 if (message.tip != null) {
28 text += "\n${message.tip}"; 28 text += "\n${message.tip}";
29 } 29 }
30 if (uri == null && charOffset == -1) { 30 if (uri == null && charOffset == -1) {
31 throw text; 31 throw text;
32 } else { 32 } else {
33 throw deprecated_format(uri, charOffset, text); 33 throw deprecated_format(uri, charOffset, text);
34 } 34 }
35 } 35 }
36 36
37 dynamic unimplemented(String what, int charOffset, Uri uri) { 37 dynamic unimplemented(String what, [int charOffset = -1, Uri uri = null]) {
38 return internalProblem( 38 return internalProblem(
39 templateInternalProblemUnimplemented.withArguments(what), 39 templateInternalProblemUnimplemented.withArguments(what),
40 charOffset, 40 charOffset,
41 uri); 41 uri);
42 } 42 }
43 43
44 dynamic unhandled(String what, String where, int charOffset, Uri uri) { 44 dynamic unhandled(String what, String where, int charOffset, Uri uri) {
45 return internalProblem( 45 return internalProblem(
46 templateInternalProblemUnhandled.withArguments(what, where), 46 templateInternalProblemUnhandled.withArguments(what, where),
47 charOffset, 47 charOffset,
48 uri); 48 uri);
49 } 49 }
50 50
51 dynamic unexpected(String expected, String actual, int charOffset, Uri uri) { 51 dynamic unexpected(String expected, String actual, int charOffset, Uri uri) {
52 return internalProblem( 52 return internalProblem(
53 templateInternalProblemUnexpected.withArguments(expected, actual), 53 templateInternalProblemUnexpected.withArguments(expected, actual),
54 charOffset, 54 charOffset,
55 uri); 55 uri);
56 } 56 }
57 57
58 dynamic unsupported(String operation, int charOffset, Uri uri) { 58 dynamic unsupported(String operation, int charOffset, Uri uri) {
59 return internalProblem( 59 return internalProblem(
60 templateInternalProblemUnsupported.withArguments(operation), 60 templateInternalProblemUnsupported.withArguments(operation),
61 charOffset, 61 charOffset,
62 uri); 62 uri);
63 } 63 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698