Package com.patreonshout.rest
Class BaseSvc
java.lang.Object
com.patreonshout.rest.BaseSvc
- Direct Known Subclasses:
ListsRepositoryImpl,ListSvc,PostsRepositoryImpl,PostSvc,ReceiverSvc,SearchFiltersRepositoryImpl,SearchFilterSvc,TagSvc,WebAccountSvc
@CrossOrigin
public class BaseSvc
extends java.lang.Object
Parental service that any
RestController objects must extend. Contains controller-wide Exception Handler.-
Constructor Summary
Constructors Constructor Description BaseSvc() -
Method Summary
Modifier and Type Method Description org.springframework.http.ResponseEntity<?>catchCustomException(PSException ex)org.springframework.http.ResponseEntity<?>catchSQLIntegrityConstraintViolationException(java.sql.SQLIntegrityConstraintViolationException ex)Handles everySQLIntegrityConstraintViolationExceptionexception thrown by controllers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
BaseSvc
public BaseSvc()
-
-
Method Details
-
catchSQLIntegrityConstraintViolationException
@ExceptionHandler(java.sql.SQLIntegrityConstraintViolationException.class) public org.springframework.http.ResponseEntity<?> catchSQLIntegrityConstraintViolationException(java.sql.SQLIntegrityConstraintViolationException ex)Handles everySQLIntegrityConstraintViolationExceptionexception thrown by controllers.- Parameters:
ex- Auto-providedSQLIntegrityConstraintViolationExceptionobject.- Returns:
- Jackson JSON compatible
ResponseEntitycontaining an HTTP error code and message.
-
catchCustomException
@ExceptionHandler(PSException.class) public org.springframework.http.ResponseEntity<?> catchCustomException(PSException ex)
-