Skip to content

Commit

Permalink
feat: better packageDirectory error
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Mar 17, 2023
1 parent 0e24911 commit ade927c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sfProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,9 @@ export class SfProject {
*/
public getDefaultPackage(): NamedPackageDir {
if (!this.hasPackages()) {
throw new SfError('The sfdx-project.json does not have any packageDirectories defined.');
throw new SfError('The sfdx-project.json does not have any packageDirectories defined.', 'NoPackageDirectories', [
`Check ${this.getPath()} for packageDirectories.`,
]);
}
const defaultPackage = this.findPackage((packageDir) => packageDir.default === true);
return defaultPackage ?? this.getPackageDirectories()[0];
Expand Down

0 comments on commit ade927c

Please sign in to comment.