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

Issue 14253005: Migrate pub away from throwing strings. (Closed)

Created:
7 years, 8 months ago by nweiz
Modified:
7 years, 8 months ago
Reviewers:
Bob Nystrom
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Migrate pub away from throwing strings. This also makes it a little more intelligent about which errors it prints what information for. BUG=9921 Committed: https://code.google.com/p/dart/source/detail?r=21698

Patch Set 1 #

Total comments: 10

Patch Set 2 : Code review changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+100 lines, -46 lines) Patch
M utils/pub/command_lish.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/pub/entrypoint.dart View 1 1 chunk +1 line, -2 lines 0 comments Download
M utils/pub/hosted_source.dart View 1 1 chunk +4 lines, -4 lines 0 comments Download
M utils/pub/http.dart View 1 2 chunks +5 lines, -6 lines 0 comments Download
M utils/pub/io.dart View 4 chunks +13 lines, -9 lines 0 comments Download
M utils/pub/pub.dart View 1 chunk +18 lines, -4 lines 0 comments Download
M utils/pub/pubspec.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M utils/pub/source.dart View 1 4 chunks +9 lines, -5 lines 0 comments Download
M utils/pub/source_registry.dart View 3 chunks +5 lines, -7 lines 0 comments Download
M utils/pub/utils.dart View 1 2 chunks +32 lines, -0 lines 0 comments Download
M utils/tests/pub/command_line_config.dart View 1 1 chunk +3 lines, -1 line 0 comments Download
M utils/tests/pub/descriptor/tar.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/tests/pub/test_pub.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/tests/pub/version_solver_test.dart View 3 chunks +6 lines, -4 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
nweiz
7 years, 8 months ago (2013-04-18 18:09:52 UTC) #1
Bob Nystrom
https://codereview.chromium.org/14253005/diff/1/utils/pub/entrypoint.dart File utils/pub/entrypoint.dart (right): https://codereview.chromium.org/14253005/diff/1/utils/pub/entrypoint.dart#newcode90 utils/pub/entrypoint.dart:90: throw new UserFacingException('Package ${id.name} not found in ' That ...
7 years, 8 months ago (2013-04-18 18:18:31 UTC) #2
nweiz
https://codereview.chromium.org/14253005/diff/1/utils/pub/entrypoint.dart File utils/pub/entrypoint.dart (right): https://codereview.chromium.org/14253005/diff/1/utils/pub/entrypoint.dart#newcode90 utils/pub/entrypoint.dart:90: throw new UserFacingException('Package ${id.name} not found in ' On ...
7 years, 8 months ago (2013-04-18 18:37:24 UTC) #3
Bob Nystrom
LGTM. https://codereview.chromium.org/14253005/diff/1/utils/pub/entrypoint.dart File utils/pub/entrypoint.dart (right): https://codereview.chromium.org/14253005/diff/1/utils/pub/entrypoint.dart#newcode90 utils/pub/entrypoint.dart:90: throw new UserFacingException('Package ${id.name} not found in ' ...
7 years, 8 months ago (2013-04-18 20:02:13 UTC) #4
nweiz
Committed patchset #2 manually as r21698 (presubmit successful).
7 years, 8 months ago (2013-04-18 20:08:32 UTC) #5
nweiz
7 years, 8 months ago (2013-04-18 20:12:01 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/14253005/diff/1/utils/pub/entrypoint.dart
File utils/pub/entrypoint.dart (right):

https://codereview.chromium.org/14253005/diff/1/utils/pub/entrypoint.dart#new...
utils/pub/entrypoint.dart:90: throw new UserFacingException('Package ${id.name}
not found in '
On 2013/04/18 20:02:13, Bob Nystrom wrote:
> On 2013/04/18 18:37:24, nweiz wrote:
> > On 2013/04/18 18:18:31, Bob Nystrom wrote:
> > > That name is a bit strange. How about "PubFailure"?
> > 
> > "PubFailure" sounds very generic to me. Is an unexpected error not also pub
> > failing?
> 
> I guess so, but I'd consider that more of an underlying failure. Maybe
> ApplicationException?
> 
> > 
> > > Also, how do you feel about a helper function that does this, like:
> > > 
> > > fail(String message) => throw new ...
> > > 
> > > That might get rid of some of the annoying wrapped strings.
> > 
> > Done.
> 

Done.

Powered by Google App Engine
This is Rietveld 408576698