> On Oct. 21, 2016, 2:27 a.m., Madhan Neethiraj wrote:
> > webapp/src/main/java/org/apache/atlas/web/errors/LoggingExceptionMapper.java,
> >  line 42
> > <https://reviews.apache.org/r/52995/diff/5/?file=1542438#file1542438line42>
> >
> >     Instead of replacing generic type E with AtlasBaseException, it might 
> > be better to handle AtlasBaseException type of exception inside 
> > toResponse(E excp) - similar to how WebApplicationException is handled.
> >     
> >     Woud that make this mapper to handle more type of exceptions? Please 
> > review.
> 
> Apoorv Naik wrote:
>     This ExceptionMapper was never used for some reason, hence I specialized 
> if for AtlasBaseException. Can definitely be made generic to capture and 
> translate more exceptions.

Ok so I made it generic but the Jersey system doesn't like for some reason and 
starts throwing NPEs causing the server startup to fail. Let's keep the 
exception mapper specifically for AtlasBaseException now and later we can make 
it more versatile.

```
java.lang.NullPointerException
        at java.lang.Class.isAssignableFrom(Native Method)
        at 
com.sun.jersey.server.impl.application.ExceptionMapperFactory.getExceptionType(ExceptionMapperFactory.java:115)
        at 
com.sun.jersey.server.impl.application.ExceptionMapperFactory.init(ExceptionMapperFactory.java:75)
        at 
com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1335)
        at 
com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180)
        at 
com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799)
        at 
com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795)
        at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
        at 
com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795)
        at 
com.sun.jersey.guice.spi.container.servlet.GuiceContainer.initiate(GuiceContainer.java:121)
        at 
com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:339)
        at 
com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605)
```


- Apoorv


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52995/#review153487
-----------------------------------------------------------


On Oct. 21, 2016, 5:04 a.m., Apoorv Naik wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52995/
> -----------------------------------------------------------
> 
> (Updated Oct. 21, 2016, 5:04 a.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj, Sarath Subramanian, Shwetha GS, 
> and Suma Shivaprasad.
> 
> 
> Bugs: ATLAS-1200
>     https://issues.apache.org/jira/browse/ATLAS-1200
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> Enhanced AtlasBaseException class to accept AtlasErrorCode enum and 
> parameters for the formatted error message.
> AtlasErrorCode enum captures all AtlasErrors identified by a unique code such 
> as AtlasE4001 etc.
> 
> Each error code has a error message/description which is mapped under 
> errorMessage.properties (for I18N) and can be parameterized to provide more 
> context about the failure.
> 
> 
> Diffs
> -----
> 
>   common/src/main/java/org/apache/atlas/AtlasConstants.java 
> 8521f630e202adc3024d7fd7a94a76c5a52771fa 
>   intg/src/main/java/org/apache/atlas/AtlasErrorCode.java PRE-CREATION 
>   intg/src/main/java/org/apache/atlas/exception/AtlasBaseException.java 
> 3538f41355b23b60e79be4179cc7a05100bd7817 
>   intg/src/main/java/org/apache/atlas/model/typedef/AtlasTypesDef.java 
> 5d3f4a38a7a34a973dc7bd43c3913c7b7925265b 
>   
> repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
>  12047bfd80c6fb37b61dfd401b35f9e3dfb41043 
>   
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasClassificationDefStoreV1.java
>  7b6e08a8b86889b64c57c82d53c55d0a9370e3b1 
>   
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityDefStoreV1.java
>  308a5294607ffb7d8c5938b9cde9f828da5043ee 
>   
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEnumDefStoreV1.java
>  5c55d421a43a3579595b76a84360b4cd5dfcc7c9 
>   
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasStructDefStoreV1.java
>  eeb08d0a4bdb4592e4837df410eb3097bd55d26a 
>   
> repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java
>  663470790dda87ea982ab63f22b94d3d576fd4ee 
>   
> webapp/src/main/java/org/apache/atlas/web/errors/LoggingExceptionMapper.java 
> 9830269d35aed961f0eecdfa6a57edf93e982de5 
>   webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java 
> 065836143b3f2604ea6e3754069afea77e87f9c1 
>   webapp/src/main/webapp/WEB-INF/web.xml 
> c5518142492dab0e343caf4cedbe8eb1a645364a 
> 
> Diff: https://reviews.apache.org/r/52995/diff/
> 
> 
> Testing
> -------
> 
> Tested will REST API calls.
> Unit Tests coverage will be added as a part of the UT review request for 
> TypesREST stores.
> 
> 
> Thanks,
> 
> Apoorv Naik
> 
>

Reply via email to