Skip to content

Commit

Permalink
[FIX] application: Improve error message for missing manifest.json
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Oct 30, 2023
1 parent 620819c commit 016a846
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/specifications/types/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ class Application extends ComponentProject {
// relevant for the rather "uncommon" App Variants)
throw new Error(
`Could not find required manifest.json for project ` +
`${this.getName()}: ${manifestJsonError.message}`);
`${this.getName()}: ${manifestJsonError.message}\n\n` +
`If you are about to start a new project, please refer to:\n` +
`https://sap.github.io/ui5-tooling/v3/pages/GettingStarted/#starting-a-new-project`, {
cause: manifestJsonError
});
}
throw appDescVarError;
}
Expand Down
5 changes: 4 additions & 1 deletion test/lib/specifications/types/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,10 @@ test("_getNamespace: Correct error message if fallback to manifest.appdescr_vari
const error = await t.throwsAsync(project._getNamespace());
t.deepEqual(error.message,
"Could not find required manifest.json for project application.a: " +
"No such stable or directory: manifest.json",
"No such stable or directory: manifest.json" +
"\n\n" +
"If you are about to start a new project, please refer to:\n" +
"https://sap.github.io/ui5-tooling/v3/pages/GettingStarted/#starting-a-new-project",
"Rejected with correct error message");

t.is(_getManifestStub.callCount, 2, "_getManifest called exactly twice");
Expand Down

0 comments on commit 016a846

Please sign in to comment.