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

Issue 2979623002: Use messages for (some) public API errors (Closed)

Created:
3 years, 5 months ago by Siggi Cherem (dart-lang)
Modified:
3 years, 5 months ago
Reviewers:
Paul Berry, ahe
CC:
reviews_dartlang.org, dart-uxr+reviews_google.com, dart-fe-team+reviews_google.com
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Use messages for (some) public API errors not entirely ready - looking for comments. BUG= R=ahe@google.com Committed: https://github.com/dart-lang/sdk/commit/a7865761d4829bc5d3cbd7da857faba0081311b4

Patch Set 1 #

Total comments: 23

Patch Set 2 : wrap - verification error still pending #

Total comments: 15

Patch Set 3 : cl comments #

Total comments: 22
Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -40 lines) Patch
M pkg/front_end/lib/compilation_error.dart View 1 1 chunk +8 lines, -6 lines 0 comments Download
M pkg/front_end/lib/kernel_generator.dart View 2 chunks +2 lines, -1 line 0 comments Download
M pkg/front_end/lib/src/base/processed_options.dart View 1 2 6 chunks +47 lines, -17 lines 14 comments Download
M pkg/front_end/lib/src/fasta/fasta_codes_generated.dart View 1 2 2 chunks +91 lines, -0 lines 0 comments Download
M pkg/front_end/lib/src/fasta/kernel/kernel_target.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M pkg/front_end/lib/src/fasta/kernel/verifier.dart View 1 2 2 chunks +14 lines, -3 lines 0 comments Download
M pkg/front_end/lib/src/fasta/problems.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M pkg/front_end/lib/src/kernel_generator_impl.dart View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M pkg/front_end/messages.yaml View 1 2 2 chunks +17 lines, -0 lines 2 comments Download
M pkg/front_end/test/kernel_generator_test.dart View 1 2 chunks +6 lines, -4 lines 2 comments Download
M pkg/front_end/test/src/base/processed_options_test.dart View 3 chunks +3 lines, -3 lines 2 comments Download
M pkg/front_end/test/subpackage_relationships_test.dart View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M pkg/front_end/tool/_fasta/generate_messages.dart View 1 2 1 chunk +5 lines, -0 lines 2 comments Download
M pkg/front_end/tool/perf.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 23 (7 generated)
Siggi Cherem (dart-lang)
https://codereview.chromium.org/2979623002/diff/20001/pkg/front_end/lib/compilation_error.dart File pkg/front_end/lib/compilation_error.dart (right): https://codereview.chromium.org/2979623002/diff/20001/pkg/front_end/lib/compilation_error.dart#newcode17 pkg/front_end/lib/compilation_error.dart:17: abstract class CompilationError { Paul - I like the ...
3 years, 5 months ago (2017-07-11 03:57:13 UTC) #4
Paul Berry
https://codereview.chromium.org/2979623002/diff/20001/pkg/front_end/lib/compilation_error.dart File pkg/front_end/lib/compilation_error.dart (right): https://codereview.chromium.org/2979623002/diff/20001/pkg/front_end/lib/compilation_error.dart#newcode17 pkg/front_end/lib/compilation_error.dart:17: abstract class CompilationError { On 2017/07/11 03:57:13, Siggi Cherem ...
3 years, 5 months ago (2017-07-11 16:01:00 UTC) #5
Siggi Cherem (dart-lang)
https://codereview.chromium.org/2979623002/diff/20001/pkg/front_end/lib/src/base/processed_options.dart File pkg/front_end/lib/src/base/processed_options.dart (right): https://codereview.chromium.org/2979623002/diff/20001/pkg/front_end/lib/src/base/processed_options.dart#newcode150 pkg/front_end/lib/src/base/processed_options.dart:150: reportMessageNoLocation(messageCombinedCompileSdkAndSummary); On 2017/07/11 16:00:59, Paul Berry wrote: > IMO ...
3 years, 5 months ago (2017-07-11 16:03:48 UTC) #6
Paul Berry
On 2017/07/11 16:03:48, Siggi Cherem (dart-lang) wrote: > https://codereview.chromium.org/2979623002/diff/20001/pkg/front_end/lib/src/base/processed_options.dart > File pkg/front_end/lib/src/base/processed_options.dart (right): > > ...
3 years, 5 months ago (2017-07-11 17:00:31 UTC) #7
Siggi Cherem (dart-lang)
Thanks Paul for all the comments, I updated the CL to do the wrapping as ...
3 years, 5 months ago (2017-07-12 00:29:46 UTC) #9
Siggi Cherem (dart-lang)
https://codereview.chromium.org/2979623002/diff/80001/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart File pkg/front_end/lib/src/fasta/kernel/kernel_target.dart (right): https://codereview.chromium.org/2979623002/diff/80001/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart#newcode100 pkg/front_end/lib/src/fasta/kernel/kernel_target.dart:100: final List<LocatedMessage> errors = <LocatedMessage>[]; note: this is now ...
3 years, 5 months ago (2017-07-12 00:35:15 UTC) #11
ahe
lgtm except for deprecated_InputError implementing LocatedMessage (see explanation below). We're both working on the same ...
3 years, 5 months ago (2017-07-12 13:14:44 UTC) #12
ahe
Sorry, I didn't see this discussion earlier. I've already landed some changes that goes against ...
3 years, 5 months ago (2017-07-12 14:24:14 UTC) #13
Siggi Cherem (dart-lang)
addressed all comments. Made a minor change to `unimplemented` so it takes optional arguments (places ...
3 years, 5 months ago (2017-07-12 21:55:00 UTC) #15
Siggi Cherem (dart-lang)
Committed patchset #3 (id:120001) manually as a7865761d4829bc5d3cbd7da857faba0081311b4 (presubmit successful).
3 years, 5 months ago (2017-07-12 21:55:28 UTC) #17
ahe
On 2017/07/12 21:55:00, Siggi Cherem (dart-lang) wrote: > addressed all comments. Made a minor change ...
3 years, 5 months ago (2017-07-12 23:37:34 UTC) #18
ahe
https://codereview.chromium.org/2979623002/diff/20001/pkg/front_end/lib/compilation_error.dart File pkg/front_end/lib/compilation_error.dart (right): https://codereview.chromium.org/2979623002/diff/20001/pkg/front_end/lib/compilation_error.dart#newcode17 pkg/front_end/lib/compilation_error.dart:17: abstract class CompilationError { On 2017/07/12 21:54:58, Siggi Cherem ...
3 years, 5 months ago (2017-07-12 23:44:56 UTC) #19
Siggi Cherem (dart-lang)
On 2017/07/12 23:37:34, ahe wrote: > On 2017/07/12 21:55:00, Siggi Cherem (dart-lang) wrote: > > ...
3 years, 5 months ago (2017-07-12 23:51:01 UTC) #20
ahe
Still lgtm, but please reconsider making the position parameters mandatory on unimplemented. https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/lib/src/base/processed_options.dart File pkg/front_end/lib/src/base/processed_options.dart ...
3 years, 5 months ago (2017-07-13 00:03:38 UTC) #21
ahe
https://codereview.chromium.org/2979623002/diff/20001/pkg/front_end/lib/compilation_error.dart File pkg/front_end/lib/compilation_error.dart (right): https://codereview.chromium.org/2979623002/diff/20001/pkg/front_end/lib/compilation_error.dart#newcode17 pkg/front_end/lib/compilation_error.dart:17: abstract class CompilationError { On 2017/07/12 23:44:56, ahe wrote: ...
3 years, 5 months ago (2017-07-13 00:06:03 UTC) #22
Siggi Cherem (dart-lang)
3 years, 5 months ago (2017-07-18 00:32:57 UTC) #23
Message was sent while issue was closed.
https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/lib/src/...
File pkg/front_end/lib/src/base/processed_options.dart (right):

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/lib/src/...
pkg/front_end/lib/src/base/processed_options.dart:122: _raw.onError(new
_CompilationMessage(message));
On 2017/07/13 00:03:38, ahe wrote:
> We need to think about how these methods deal with _raw.onError throwing an
> exception.
> 
> We do not want to report that as a crash if we add crash reporting like in
> dart2js.

Acknowledged.

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/lib/src/...
pkg/front_end/lib/src/base/processed_options.dart:135:
templateMissingInputFile.withArguments('$source'));
On 2017/07/13 00:03:38, ahe wrote:
> There's a #uri parameter you can use now. It will automatically make the URI
> relative, but preserve the full URI in the arguments object.

Done.

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/lib/src/...
pkg/front_end/lib/src/base/processed_options.dart:143:
templateMissingSdkRoot.withArguments('$sdkRoot'));
On 2017/07/13 00:03:38, ahe wrote:
> Ditto.

Done.

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/lib/src/...
pkg/front_end/lib/src/base/processed_options.dart:150:
templateMissingSdkSummary.withArguments('$summary'));
On 2017/07/13 00:03:38, ahe wrote:
> Ditto.

Done.

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/lib/src/...
pkg/front_end/lib/src/base/processed_options.dart:157: "The compileSdk and
sdkSummary options are mutually exclusive"));
On 2017/07/13 00:03:37, ahe wrote:
> I think this should be its own error code, but I can live with this.
> 
> I think so because this error is likely to be seen by users of the API.

Done.

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/lib/src/...
pkg/front_end/lib/src/base/processed_options.dart:363: final LocatedMessage
original;
On 2017/07/13 00:03:38, ahe wrote:
> This should probably be private as you've stated several times that properties
> of this object aren't exposed in the public API.

Ok, I've added this to the CL where I'm unifying CompilerContext and
ProcessedOptions.

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/lib/src/...
pkg/front_end/lib/src/base/processed_options.dart:378: /// Wraps an error
message as a [CompilationError] API.
On 2017/07/13 00:03:38, ahe wrote:
> Use templateUnspecified instead?

This is now gone.

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/messages...
File pkg/front_end/messages.yaml (right):

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/messages...
pkg/front_end/messages.yaml:652: template: "Input file not found: #string."
On 2017/07/13 00:03:38, ahe wrote:
> #uri here and below?

Done.

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/test/ker...
File pkg/front_end/test/kernel_generator_test.dart (right):

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/test/ker...
pkg/front_end/test/kernel_generator_test.dart:61: expect(errors.first.message,
contains("No 'main' method found"));
On 2017/07/13 00:03:38, ahe wrote:
> I think this might work:
> 
> equals(messageMissingMain.message)

Done.

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/test/src...
File pkg/front_end/test/src/base/processed_options_test.dart (right):

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/test/src...
pkg/front_end/test/src/base/processed_options_test.dart:165:
expect(errors.first.message, contains("SDK root directory not found"));
On 2017/07/13 00:03:38, ahe wrote:
> For the same trick to work here, you'd have to remove the #string (or #uri)
> parameter.

Done. Already landed this fix in a separate CL.

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/tool/_fa...
File pkg/front_end/tool/_fasta/generate_messages.dart (right):

https://codereview.chromium.org/2979623002/diff/120001/pkg/front_end/tool/_fa...
pkg/front_end/tool/_fasta/generate_messages.dart:58: exit(1);
On 2017/07/13 00:03:38, ahe wrote:
> How about:
> 
> exitCode = 1;

Done.

Powered by Google App Engine
This is Rietveld 408576698