Administrator

Exception Mapping

Exceptions thrown by endpoints are automatically caught and mapped to error codes, which are set in the MobiliserResponse object. The base MobiliserServiceException has an implicit error code field that is used for this mapping. Other exceptions are mapped to a constant value, or are configured in this file to those values. To avoid mapping an exception (allowing it to pass), add a mapping to the configuration file that maps it to nothing.

ConfigAdmin PID: com.sybase365.mobiliser.framework.service.api

You can set these configuration options, which can be updated at runtime:
1  
2# Simple mapping from exception class to error code 
3# you can list parent classes here and subclasses 
4# will be mapped to the error code of the parent  
5 
6# you can also add entries and map no number which will 
7# cause the exception not to be mapped, but propagated  
8 
9  org.springframework.dao.DataAccessException=9935 
10 org.springframework.dao.DuplicateKeyException=9930 
11 org.springframework.dao.DataIntegrityViolationException=9931
12 org.springframework.jdbc.BadSqlGrammarException=9932 
13 org.springframework.orm.ObjectRetrievalFailureException=9933
14 org.springframework.transaction.TransactionException=9935 
15 
16 org.springframework.security.access.AccessDeniedException=