Skip to content

Commit

Permalink
Error reporting in run-android (#1891)
Browse files Browse the repository at this point in the history
Co-authored-by: Arushi Kesarwani <arushikesarwani@meta.com>
  • Loading branch information
arushikesarwani94 and arushikesarwani94 authored Mar 27, 2023
1 parent 917f1bf commit abbec76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ function createInstallError(error: Error & {stderr: string}) {
)}."`;
}

return new CLIError(`Failed to install the app. ${message}`, error);
return new CLIError(
`Failed to install the app. ${message}`,
message.length > 0 ? undefined : error,
);
}

export default runOnAllDevices;
3 changes: 2 additions & 1 deletion packages/cli-platform-android/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {getPackageName} from './getAndroidProject';
import {findLibraryName} from './findLibraryName';
import {findComponentDescriptors} from './findComponentDescriptors';
import {findBuildGradle} from './findBuildGradle';
import {CLIError} from '@react-native-community/cli-tools';

/**
* Gets android project config by analyzing given folder and taking some
Expand Down Expand Up @@ -53,7 +54,7 @@ export function projectConfig(
userConfig.packageName || getPackageName(manifestPath, buildGradlePath);

if (!packageName) {
throw new Error(
throw new CLIError(
`Package name not found in neither ${manifestPath} nor ${buildGradlePath}`,
);
}
Expand Down

0 comments on commit abbec76

Please sign in to comment.