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

Annotated all the other exception mappers with @Provider to simplify the WildcardExceptionMapper. #497

Closed
wants to merge 2 commits into from

Conversation

lsitu
Copy link
Contributor

@lsitu lsitu commented Oct 3, 2014

https://www.pivotaltracker.com/s/projects/684825/stories/78554672
Added exception mappers as the first step to simplify the WildcardExceptionMapper.

@awoods
Copy link

awoods commented Oct 5, 2014

Please add @Provider to the class:
AccessDeniedExceptionMapper.java

return new AccessControlExceptionMapper()
.toResponse((java.security.AccessControlException) e);
}

if (javax.jcr.AccessDeniedException.class.isAssignableFrom(e.getClass())) {
return new AccessDeniedExceptionMapper()
Copy link

Choose a reason for hiding this comment

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

I would expect that once you add @Provider to the class:
AccessDeniedExceptionMapper.java

...that you should be able to remove the "if" clauses for all of the classes here that are handled by exception-mappers, i.e.:

  • AccessDeniedExceptionMapper
  • AccessControlExceptionMapper
  • LockExceptionMapper
  • TransactionMissingExceptionMapper
  • JsonParseExceptionMapper
  • RepositoryExceptionMapper

removed the "if" clauses when possible as suggested.
@lsitu
Copy link
Contributor Author

lsitu commented Oct 7, 2014

I've added annotation @Provider for the AccessDeniedExceptionMapper and removed the "if" clauses when possible. But some exceptions are wrapped up by other exceptions that can't be handled by the framework and we may not remove all the "if" clause from the WildcardException. For example, the LockExceptions in the exception cause, which will cause some lock testing cases failed when the "if" clause removed. See lsitu@c07c80f above.

@awoods
Copy link

awoods commented Oct 13, 2014

Resolved with: b214e5c

@awoods awoods closed this Oct 13, 2014
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.

None yet

2 participants