Skip to content

Commit ffc989d

Browse files
committed
Elaborate error message
1 parent 64ac465 commit ffc989d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

pkgs/code_assets/lib/src/code_assets/validation.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,10 @@ ValidationErrors _validateFile(
301301
}) {
302302
final errors = <String>[];
303303
if (mustBeAbsolute && !uri.isAbsolute) {
304-
errors.add('$name (${uri.toFilePath()}) must be an absolute path.');
304+
errors.add(
305+
'$name (${uri.toFilePath()}) must be an absolute path. '
306+
'Prefer constructing it via `input.outputDirectoryShared`.',
307+
);
305308
}
306309
if (mustExist && !File.fromUri(uri).existsSync()) {
307310
errors.add('$name (${uri.toFilePath()}) does not exist as a file.');

pkgs/data_assets/lib/src/data_assets/validation.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ ValidationErrors _validateFile(
129129
}) {
130130
final errors = <String>[];
131131
if (mustBeAbsolute && !uri.isAbsolute) {
132-
errors.add('$name (${uri.toFilePath()}) must be an absolute path.');
132+
errors.add(
133+
'$name (${uri.toFilePath()}) must be an absolute path. '
134+
'Prefer constructing it via `input.outputDirectoryShared` or '
135+
'`input.packageRoot`.',
136+
);
133137
}
134138
if (mustExist && !File.fromUri(uri).existsSync()) {
135139
errors.add('$name (${uri.toFilePath()}) does not exist as a file.');

0 commit comments

Comments
 (0)