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

Identify Invalid SPDX File format and Invalid Tag Value file as different error. #102

Merged
merged 2 commits into from
Jul 20, 2017

Conversation

rtgdk
Copy link
Contributor

@rtgdk rtgdk commented Jul 20, 2017

I have added a new Exception InvalidFileFormatException for catching all invalid files which are not tag value or rdf files and thrown the exception where all invalid Files were failing in BuildDocument.checkAnalysisNull .

Also when handling expection I have separated, all the three exception in all the enclosing function -
Invalid file type - InvalidFileFormatException,
Invalid Tag Value File - InvalidSpdxTagFileException,
Invalid RDF or any other file not caught by the above exception - Exception ( Default Exception )

When in CompareSPDXDocs.convertTagValueToRdf the first two exception are caught and thrown as SpdxCompareException which result in terminating the function and show proper error. This way, these two types of file will not be passed as RDF Files in later function.

Only Invalid RDF, Valid RDF or any other file not caught by the first two exception are passed in the second function to check for RDF files.

…rent error.

	*Add a new Exception InvalidFileFormatException for all invalid spdx supported file formats.
	*Pass on correct error to enclosing function to identify invalid file or invalid tag value file or rdf file.

Signed-off-by: rtgdk <[email protected]>
Copy link
Member

@goneall goneall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one requested change - can you add a comment for the new exception InvalidFileFormtaException describing it - there are good comments in the code that uses the exception, but there should also be a comment for the exception class

@rtgdk
Copy link
Contributor Author

rtgdk commented Jul 20, 2017

@goneall Done.

@goneall goneall merged commit 4c4b0bd into spdx:master Jul 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants