Skip to content

Commit

Permalink
improve message
Browse files Browse the repository at this point in the history
  • Loading branch information
imakunin committed May 24, 2024
1 parent c7d35f6 commit d2db3f0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.FileSystemException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
Expand Down Expand Up @@ -57,7 +58,10 @@ static void installLocalModule(String name, String url, Path path, Logger log, L
extractFiles(tempFile, path);
} catch (Exception e) {
log.error("Failed to install local module '{}'", name, e);
var errorMessage = "Failed to install local module '%s': %s".formatted(name, e.getMessage());
var excType = e instanceof FileSystemException fse
? fse.getClass().getSimpleName() + " "
: "";
var errorMessage = "Failed to install local module '%s': %s%s".formatted(name, excType, e.getMessage());
userErr.log(errorMessage);

if (tempFile != null) {
Expand Down

0 comments on commit d2db3f0

Please sign in to comment.