Skip to content
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

Display invalid project folder in logs #11876

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
class InvalidProjectFolderException extends GeneratorException {

public InvalidProjectFolderException() {
super(badRequest(ProjectFolderErrorKey.INVALID_FOLDER).message("Project folder is not valid"));
public InvalidProjectFolderException(String folder) {
super(badRequest(ProjectFolderErrorKey.INVALID_FOLDER).message("Project folder is not valid: " + folder));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public JHipsterModuleProperties toDomain(ProjectFolder jHipsterProjectFolderFact

private void assertValidProjectFolder(ProjectFolder jHipsterProjectFolderFactory) {
if (jHipsterProjectFolderFactory.isInvalid(projectFolder)) {
throw new InvalidProjectFolderException();
throw new InvalidProjectFolderException(projectFolder);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class InvalidProjectFolderExceptionTest {

@Test
void shouldGetExceptionInformation() {
InvalidProjectFolderException exception = new InvalidProjectFolderException();
InvalidProjectFolderException exception = new InvalidProjectFolderException("/chips");

assertThat(exception.getMessage()).isEqualTo("Project folder is not valid");
assertThat(exception.getMessage()).isEqualTo("Project folder is not valid: /chips");
assertThat(exception.status()).isEqualTo(ErrorStatus.BAD_REQUEST);
assertThat(exception.key()).isEqualTo(ProjectFolderErrorKey.INVALID_FOLDER);
}
Expand Down