Compare commits
No commits in common. "a662c49064d2a3fb8fddb57767f229b481cf1891" and "ed8a8203e8bf70c5263623e7385f0a204c10c80b" have entirely different histories.
a662c49064
...
ed8a8203e8
@ -71,12 +71,7 @@ public class AdminUserConfiguration implements JobExecutionListener {
|
||||
|
||||
@Bean
|
||||
public ItemProcessor<AdminUserSyncResponse, AdminUserSyncResponse> adminUserProcessor() {
|
||||
return item -> {
|
||||
if (item.getCategory() != null && item.getCategory().length() > 20) {
|
||||
item.setCategory(item.getCategory().substring(0, 20));
|
||||
}
|
||||
return item;
|
||||
};
|
||||
return item -> item;
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.interplug.qcast.config.Exception;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
@ -13,7 +12,6 @@ public class GlobalExceptionHandler {
|
||||
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
|
||||
protected ResponseEntity<ErrorResponse> handle(HttpRequestMethodNotSupportedException e) {
|
||||
return ResponseEntity.badRequest()
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(ErrorResponse.of(ErrorCode.METHOD_NOT_ALLOWED.getMessage()));
|
||||
}
|
||||
|
||||
@ -21,7 +19,6 @@ public class GlobalExceptionHandler {
|
||||
protected ResponseEntity<ErrorResponse> handle(BaseException e) {
|
||||
final ErrorCode errorCode = e.getErrorCode();
|
||||
return ResponseEntity.status(errorCode.getStatus())
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(ErrorResponse.of(errorCode.getMessage()));
|
||||
}
|
||||
|
||||
@ -30,18 +27,14 @@ public class GlobalExceptionHandler {
|
||||
final ErrorCode errorCode = e.getErrorCode();
|
||||
if (e.getMessage() == null) {
|
||||
return ResponseEntity.status(errorCode.getStatus())
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(ErrorResponse.of(errorCode.getMessage()));
|
||||
}
|
||||
return ResponseEntity.status(errorCode.getStatus())
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(ErrorResponse.of(e.getMessage()));
|
||||
return ResponseEntity.status(errorCode.getStatus()).body(ErrorResponse.of(e.getMessage()));
|
||||
}
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
protected ResponseEntity<ErrorResponse> handle(Exception e) {
|
||||
return ResponseEntity.internalServerError()
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(ErrorResponse.of(ErrorCode.INTERNAL_SERVER_ERROR.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user