Chromium Code Reviews

Issue 391363004: Include file path in JSON error when possible. (Closed)

Created:
6 years, 5 months ago by Bob Nystrom
Modified:
6 years, 5 months ago
Reviewers:
nweiz
CC:
reviews_dartlang.org, Paul Berry, Brian Wilkerson
Visibility:
Public.

Description

Include file path in JSON error when possible. I also cleaned up a bunch of unused imports. BUG=https://code.google.com/p/dart/issues/detail?id=20067 R=nweiz@google.com Committed: https://code.google.com/p/dart/source/detail?r=38352

Patch Set 1 #

Total comments: 12

Patch Set 2 : Revise. #

Total comments: 2
Unified diffs Side-by-side diffs Stats (+88 lines, -108 lines)
M sdk/lib/_internal/pub/lib/src/command/global_run.dart View 1 chunk +0 lines, -10 lines 0 comments
M sdk/lib/_internal/pub/lib/src/command/run.dart View 1 chunk +0 lines, -8 lines 0 comments
M sdk/lib/_internal/pub/lib/src/exceptions.dart View 1 chunk +13 lines, -0 lines 0 comments
M sdk/lib/_internal/pub/lib/src/executable.dart View 1 chunk +0 lines, -1 line 0 comments
M sdk/lib/_internal/pub/lib/src/lock_file.dart View 3 chunks +27 lines, -16 lines 2 comments
M sdk/lib/_internal/pub/lib/src/log.dart View 1 chunk +9 lines, -0 lines 0 comments
M sdk/lib/_internal/pub/lib/src/pubspec.dart View 1 chunk +3 lines, -1 line 0 comments
M sdk/lib/_internal/pub/test/build/preserves_htaccess_test.dart View 1 chunk +0 lines, -2 lines 0 comments
M sdk/lib/_internal/pub/test/cache/repair/handles_failure_test.dart View 1 chunk +0 lines, -1 line 0 comments
M sdk/lib/_internal/pub/test/downgrade/doesnt_change_git_dependencies_test.dart View 1 chunk +0 lines, -4 lines 0 comments
M sdk/lib/_internal/pub/test/global/activate/different_version_test.dart View 1 chunk +0 lines, -3 lines 0 comments
M sdk/lib/_internal/pub/test/global/activate/empty_constraint_test.dart View 1 chunk +0 lines, -3 lines 0 comments
M sdk/lib/_internal/pub/test/global/activate/installs_dependencies_test.dart View 1 chunk +0 lines, -1 line 0 comments
M sdk/lib/_internal/pub/test/global/activate/same_version_test.dart View 1 chunk +0 lines, -3 lines 0 comments
M sdk/lib/_internal/pub/test/global/activate/unknown_package_test.dart View 1 chunk +0 lines, -1 line 0 comments
M sdk/lib/_internal/pub/test/global/deactivate/deactivate_and_reactivate_package_test.dart View 1 chunk +0 lines, -4 lines 0 comments
M sdk/lib/_internal/pub/test/global/deactivate/deactivate_package_test.dart View 1 chunk +0 lines, -4 lines 0 comments
M sdk/lib/_internal/pub/test/global/deactivate/unknown_package_test.dart View 1 chunk +0 lines, -3 lines 0 comments
M sdk/lib/_internal/pub/test/global/run/nonexistent_script_test.dart View 1 chunk +0 lines, -1 line 0 comments
M sdk/lib/_internal/pub/test/global/run/runs_script_test.dart View 1 chunk +0 lines, -1 line 0 comments
M sdk/lib/_internal/pub/test/global/run/unknown_package_test.dart View 1 chunk +0 lines, -1 line 0 comments
M sdk/lib/_internal/pub/test/implicit_dependency_test.dart View 1 chunk +0 lines, -2 lines 0 comments
M sdk/lib/_internal/pub/test/lish/cloud_storage_upload_provides_an_error_test.dart View 1 chunk +0 lines, -2 lines 0 comments
A + sdk/lib/_internal/pub/test/list_package_dirs/lockfile_error_test.dart View 2 chunks +9 lines, -7 lines 0 comments
M sdk/lib/_internal/pub/test/list_package_dirs/missing_pubspec_test.dart View 2 chunks +2 lines, -2 lines 0 comments
A + sdk/lib/_internal/pub/test/list_package_dirs/pubspec_error_test.dart View 2 chunks +8 lines, -7 lines 0 comments
M sdk/lib/_internal/pub/test/lock_file_test.dart View 1 chunk +16 lines, -0 lines 0 comments
M sdk/lib/_internal/pub/test/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test.dart View 1 chunk +0 lines, -1 line 0 comments
M sdk/lib/_internal/pub/test/oauth2/with_an_expired_credentials_refreshes_and_saves_test.dart View 1 chunk +0 lines, -2 lines 0 comments
M sdk/lib/_internal/pub/test/pub_uploader_test.dart View 3 chunks +0 lines, -3 lines 0 comments
M sdk/lib/_internal/pub/test/run/displays_transformer_logs_test.dart View 1 chunk +0 lines, -2 lines 0 comments
M sdk/lib/_internal/pub/test/serve/utils.dart View 1 chunk +1 line, -1 line 0 comments
M sdk/lib/_internal/pub/test/serve/web_socket/path_to_urls_with_line_test.dart View 1 chunk +0 lines, -1 line 0 comments
M sdk/lib/_internal/pub/test/serve/web_socket/url_to_asset_id_with_line_test.dart View 1 chunk +0 lines, -1 line 0 comments
M sdk/lib/_internal/pub/test/transformer/loads_different_configurations_from_the_same_isolate_test.dart View 1 chunk +0 lines, -2 lines 0 comments
M sdk/lib/_internal/pub/test/transformers_needed_by_transformers/cycle_test.dart View 1 chunk +0 lines, -2 lines 0 comments
M sdk/lib/_internal/pub/test/transformers_needed_by_transformers/dev_transformers_test.dart View 1 chunk +0 lines, -2 lines 0 comments
M sdk/lib/_internal/pub/test/transformers_needed_by_transformers/import_dependencies_test.dart View 1 chunk +0 lines, -2 lines 0 comments
M sdk/lib/_internal/pub/test/transformers_needed_by_transformers/utils.dart View 1 chunk +0 lines, -1 line 0 comments

Messages

Total messages: 6 (0 generated)
Bob Nystrom
6 years, 5 months ago (2014-07-16 17:43:08 UTC) #1
nweiz
It would be nice to have tests of the lockfile-validation behavior like we do for ...
6 years, 5 months ago (2014-07-16 18:01:42 UTC) #2
Bob Nystrom
> It would be nice to have tests of the lockfile-validation behavior like we do ...
6 years, 5 months ago (2014-07-16 18:34:45 UTC) #3
nweiz
lgtm https://codereview.chromium.org/391363004/diff/1/sdk/lib/_internal/pub/lib/src/lock_file.dart File sdk/lib/_internal/pub/lib/src/lock_file.dart (right): https://codereview.chromium.org/391363004/diff/1/sdk/lib/_internal/pub/lib/src/lock_file.dart#newcode61 sdk/lib/_internal/pub/lib/src/lock_file.dart:61: 'Package $name is missing a version.', spec); On ...
6 years, 5 months ago (2014-07-17 07:11:19 UTC) #4
Bob Nystrom
Committed patchset #2 manually as r38352 (presubmit successful).
6 years, 5 months ago (2014-07-17 22:14:36 UTC) #5
Bob Nystrom
6 years, 5 months ago (2014-07-17 22:19:19 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/391363004/diff/1/sdk/lib/_internal/pub/lib/sr...
File sdk/lib/_internal/pub/lib/src/lock_file.dart (right):

https://codereview.chromium.org/391363004/diff/1/sdk/lib/_internal/pub/lib/sr...
sdk/lib/_internal/pub/lib/src/lock_file.dart:61: 'Package $name is missing a
version.', spec);
On 2014/07/17 07:11:19, nweiz wrote:
> On 2014/07/16 18:34:44, Bob Nystrom wrote:
> > On 2014/07/16 18:01:42, nweiz wrote:
> > > These errors originally included the package name as a means of helping
the
> > user
> > > figure out where the error was. Since SpanFormatException does that
better,
> > > including the name in the error message seems redundant.
> > 
> > I kind of like leaving in there because it reads well and means the user
> doesn't
> > have to hunt the package name down in the path, which may be unfamiliar to
> them
> > if it points into the cache.
> 
> The span will include the package name. I feel like it will read redundantly,
> but DWYW.

Acknowledged.

https://codereview.chromium.org/391363004/diff/20001/sdk/lib/_internal/pub/li...
File sdk/lib/_internal/pub/lib/src/lock_file.dart (right):

https://codereview.chromium.org/391363004/diff/20001/sdk/lib/_internal/pub/li...
sdk/lib/_internal/pub/lib/src/lock_file.dart:81: } on FormatException catch(ex)
{
On 2014/07/17 07:11:19, nweiz wrote:
> Nit: space after "catch".

Done.

Powered by Google App Engine