diff --git a/packages/shorebird_cli/lib/src/artifact_manager.dart b/packages/shorebird_cli/lib/src/artifact_manager.dart index e5fcf32d5..623584c69 100644 --- a/packages/shorebird_cli/lib/src/artifact_manager.dart +++ b/packages/shorebird_cli/lib/src/artifact_manager.dart @@ -36,7 +36,12 @@ class ArtifactManager { final result = await process.run(diffExecutable, diffArguments); if (result.exitCode != 0) { - throw Exception('Failed to create diff: ${result.stderr}'); + throw Exception( + ''' +Failed to create diff (exit code ${result.exitCode}). + stdout: ${result.stdout} + stderr: ${result.stderr}''', + ); } return diffPath; diff --git a/packages/shorebird_cli/test/src/artifact_manager_test.dart b/packages/shorebird_cli/test/src/artifact_manager_test.dart index e22df1135..ab5e77fbd 100644 --- a/packages/shorebird_cli/test/src/artifact_manager_test.dart +++ b/packages/shorebird_cli/test/src/artifact_manager_test.dart @@ -66,9 +66,11 @@ void main() { const patchArtifactPath = 'path/to/patch_artifact'; test('throws error when creating diff fails', () async { - const error = 'oops something went wrong'; + const stdout = 'uh oh'; + const stderr = 'oops something went wrong'; when(() => patchProcessResult.exitCode).thenReturn(1); - when(() => patchProcessResult.stderr).thenReturn(error); + when(() => patchProcessResult.stderr).thenReturn(stderr); + when(() => patchProcessResult.stdout).thenReturn(stdout); await expectLater( () => runWithOverrides( @@ -81,7 +83,9 @@ void main() { isA().having( (e) => e.toString(), 'exception', - 'Exception: Failed to create diff: $error', + 'Exception: Failed to create diff (exit code 1).\n' + ' stdout: $stdout\n' + ' stderr: $stderr', ), ), );