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 #149

Closed
echebbi opened this issue Jun 26, 2020 · 0 comments · Fixed by #155
Closed

Make Xtext validators resilient #149

echebbi opened this issue Jun 26, 2020 · 0 comments · Fixed by #155

Comments

@echebbi
Copy link
Collaborator

echebbi commented Jun 26, 2020

Motivation

An unexpected exception in a validator is:

  • uncaught, hence stopping the whole validation,
  • swallowed, hence not reported to the user.

Proposition

Make sure that an Exception cannot stop the execution (granularity: method) and that errors are reported to the Error Logs view.

@echebbi echebbi self-assigned this Jun 26, 2020
echebbi added a commit that referenced this issue Jun 26, 2020
Because:
 - unexpected exceptions in a validator were stopping the whole validation

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 <emmanuel.chebbi@outlook.fr>
echebbi added a commit that referenced this issue Jun 26, 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 <emmanuel.chebbi@outlook.fr>
echebbi added a commit that referenced this issue Jun 26, 2020
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 <emmanuel.chebbi@outlook.fr>
echebbi added a commit that referenced this issue Jun 26, 2020
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 <emmanuel.chebbi@outlook.fr>
echebbi added a commit that referenced this issue 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 <emmanuel.chebbi@outlook.fr>
echebbi added a commit that referenced this issue Jun 27, 2020
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 <emmanuel.chebbi@outlook.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant