Skip to content

Fix validate() to report errors for invalid SPDX expressions with tra…#126

Open
saquibsaifee wants to merge 1 commit intoaboutcode-org:mainfrom
saquibsaifee:fix/validate-trailing-operators
Open

Fix validate() to report errors for invalid SPDX expressions with tra…#126
saquibsaifee wants to merge 1 commit intoaboutcode-org:mainfrom
saquibsaifee:fix/validate-trailing-operators

Conversation

@saquibsaifee
Copy link

Description

The validate() method failed silently when encountering expressions with trailing operators (e.g. 'GPL-3.0-or-later AND'). The root cause was that the exception handler accessed e.token_string on ExpressionError, but only ExpressionParseError (a subclass) has that attribute.

Fix by catching ExpressionParseError and ExpressionError separately.

Fixes #114

…iling operators

The validate() method failed silently when encountering expressions with
trailing operators (e.g. 'GPL-3.0-or-later AND'). The root cause was that
the exception handler accessed e.token_string on ExpressionError, but only
ExpressionParseError (a subclass) has that attribute.

Fix by catching ExpressionParseError and ExpressionError separately.

Fixes aboutcode-org#114

Signed-off-by: Saquib Saifee <saquibsaifee2@gmail.com>
@saquibsaifee
Copy link
Author

Take a look at this @AyanSinhaMahapatra @pombredanne.

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.

validate() fails to report errors for invalid SPDX expressions

1 participant