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

Make Xtext validators resilient #155

Merged
merged 2 commits into from
Jun 27, 2020
Merged

Conversation

echebbi
Copy link
Collaborator

@echebbi echebbi commented Jun 26, 2020

Fix #149.

The CI pass and everything looks good to me. I'll make a last check on GEMOC Studio then proceed to merge the PR.

Changes

  • validators are now decorated with SafeValidator which ensures that exceptions thrown by validation methods are caught, logged then discard to continue the validation
  • the case where ExtendedClass::getBaseClass returns has been handled and shouldn't cause errors anymore
  • if an internal error still occurs during validation but outside validators then AleValidator will catch it and log it

echebbi added 2 commits June 26, 2020 22:23
Because:
 - internal errors may crash source file validation without any error being log (#149)

How:
 - actually catch exceptions & log them through the Activator

Signed-off-by: Emmanuel Chebbi <[email protected]>
Because:
 - unexpected exceptions in a validator were stopping the whole validation (#149)

How:
 - SafeValidator can be used to decorate IValidator and make their validation methods
   exception-proof
 - the possible absence of ExtendedClass::baseClass has been taken into account
   and is less likely to cause errors

Signed-off-by: Emmanuel Chebbi <[email protected]>
@echebbi echebbi added affect: validators Related to Xtext validators affect: editor labels Jun 26, 2020
@echebbi echebbi self-assigned this Jun 26, 2020
@echebbi
Copy link
Collaborator Author

echebbi commented Jun 27, 2020

Looks good. Attempting to open an enumeration still raise errors (see #154) but at least they are now logged. We'll decide later how to address/improve this.

@echebbi echebbi merged commit 28f307e into master Jun 27, 2020
echebbi added a commit that referenced this pull request Jun 27, 2020
Because:
 - internal errors may crash source file validation without any error being log (#149)

How:
 - actually catch exceptions & log them through the Activator

Signed-off-by: Emmanuel Chebbi <[email protected]>
@echebbi echebbi deleted the 149-make-xtext-validators-resilient branch June 27, 2020 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affect: editor affect: validators Related to Xtext validators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Xtext validators resilient
1 participant