Skip to content

Commit

Permalink
Display invalid project folder in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalgrimaud committed Feb 8, 2025
1 parent 0efd6ce commit 674a0e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
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

0 comments on commit 674a0e2

Please sign in to comment.