diff --git a/src/main/java/org/spdx/tools/Verify.java b/src/main/java/org/spdx/tools/Verify.java index 24ea84d..378f79f 100644 --- a/src/main/java/org/spdx/tools/Verify.java +++ b/src/main/java/org/spdx/tools/Verify.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Objects; +import com.fasterxml.jackson.core.JsonParseException; import org.spdx.library.InvalidSPDXAnalysisException; import org.spdx.library.Version; import org.spdx.library.model.SpdxDocument; @@ -126,6 +127,8 @@ public static List verify(String filePath, SerFileType fileType) throws doc = SpdxToolsHelper.readDocumentFromFile(store, file); } catch (FileNotFoundException e) { throw new SpdxVerificationException("File "+filePath+ " not found.",e); + } catch (JsonParseException e) { + throw new SpdxVerificationException("Invalid JSON file: "+e.getMessage(), e); } catch (IOException e) { throw new SpdxVerificationException("IO Error reading SPDX file",e); } catch (InvalidSPDXAnalysisException e) {