Skip to content

Improve some exception messaging and comments #3691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions lib/src/tool_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,18 @@ class ToolRunner {
var result =
await Process.run(commandPath, args, environment: environment);
if (result.exitCode != 0) {
toolErrorCallback('Tool "$name" returned non-zero exit code '
'(${result.exitCode}) when run as "${commandString()}" from '
'${pathContext.current}\n'
'Input to $name was:\n'
'$content\n'
'Stderr output was:\n${result.stderr}\n');
var envString =
environment.entries.map((e) => '${e.key}: ${e.value}').join(', ');
toolErrorCallback(
'Tool "$name" returned non-zero exit code '
'(${result.exitCode}) when run as "${commandString()}".\n'
' Working directory: "${pathContext.current}"\n'
' Env: $envString\n'
' Input to $name was:\n'
' $content\n'
' Stderr output was:\n'
' ${result.stderr}\n',
);
return '';
} else {
return result.stdout as String;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/warnings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ enum PackageWarning implements Comparable<PackageWarning> {
),
duplicateFile(
'duplicate-file',
'failed to write file at: {0}',
'file already written at "{0}"',
shortHelp:
'Dartdoc is trying to write to a duplicate filename based on the names '
'of Dart symbols.',
Expand Down
2 changes: 1 addition & 1 deletion tool/src/flutter_repo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class FlutterRepo {
return FlutterRepo._(flutterPath, env, cacheDart, launcher);
}

/// Copies an existing, initialized flutter repo.
/// Copies an existing, initialized flutter repo to [flutterPath].
static Future<FlutterRepo> copyFromExistingFlutterRepo(
FlutterRepo originalRepo, String flutterPath, Map<String, String> env,
[String? label]) async {
Expand Down