File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -24,12 +24,12 @@ class PackageNotFoundException implements Exception {
2424
2525class InvalidOutputException implements Exception {
2626 final Asset asset;
27+ final String message;
2728
28- InvalidOutputException (this .asset);
29+ InvalidOutputException (this .asset, this .message );
2930
3031 @override
31- String toString () => 'InvalidOutputException: $asset \n '
32- 'Files may only be output in the root (application) package.' ;
32+ String toString () => 'InvalidOutputException: $asset \n $message ' ;
3333}
3434
3535class InvalidInputException implements Exception {
Original file line number Diff line number Diff line change @@ -128,7 +128,8 @@ class BuildStepImpl implements BuildStep {
128128 /// [InvalidOutputException] or [UnexpectedOutputException] if it's not.
129129 void _checkOutput (Asset asset) {
130130 if (asset.id.package != _rootPackage) {
131- throw new InvalidOutputException (asset);
131+ throw new InvalidOutputException (
132+ asset, 'Files may only be output in the root (application) package.' );
132133 }
133134 if (! expectedOutputs.any ((id) => id == asset.id)) {
134135 throw new UnexpectedOutputException (asset);
Original file line number Diff line number Diff line change @@ -517,10 +517,12 @@ class BuildImpl {
517517 /// Validate [expectedOutputs] .
518518 for (var output in expectedOutputs) {
519519 if (output.package != _packageGraph.root.name) {
520- throw new InvalidOutputException (new Asset (output, '' ));
520+ throw new InvalidOutputException (new Asset (output, '' ),
521+ 'Files may only be output in the root (application) package.' );
521522 }
522523 if (_inputsByPackage[output.package]? .contains (output) == true ) {
523- throw new InvalidOutputException (new Asset (output, '' ));
524+ throw new InvalidOutputException (new Asset (output, '' ),
525+ 'Cannot overwrite inputs.' );
524526 }
525527 }
526528
You can’t perform that action at this time.
0 commit comments