Skip to content

Commit

Permalink
Merge pull request #86 from spdx/issue83
Browse files Browse the repository at this point in the history
Add filename to message for InvalidFileNameException
  • Loading branch information
goneall authored Oct 30, 2022
2 parents eec03f1 + 7219fdd commit af24ab7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/spdx/tools/SpdxToolsHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static SerFileType fileToFileType(File file)
String fileName = file.getName();
if (!fileName.contains(".")) {
throw new InvalidFileNameException(
"Can not convert file to file type - no file extension");
"Can not convert file to file type - no file extension for file "+file.getPath());
}
String ext = fileName.substring(fileName.lastIndexOf(".") + 1)
.toLowerCase();
Expand All @@ -140,7 +140,7 @@ public static SerFileType fileToFileType(File file)
SerFileType retval = EXT_TO_FILETYPE.get(ext);
if (Objects.isNull(retval)) {
throw new InvalidFileNameException(
"Unrecognized file extension: " + ext);
"Unrecognized file extension: " + ext + " for file "+file.getPath());
}
return retval;
}
Expand Down

0 comments on commit af24ab7

Please sign in to comment.