Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- [BUG] :goal_net: Catch all LdapException when using mono connection
- [REL] :rocket: release version 2.1.2


# 2.1.2

- [BUG] :bug: Fix max time before a connection is dropped from ldap connection pool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@ public class SugoiAdviceController {
@ExceptionHandler(Exception.class)
@ResponseBody
public ResponseEntity<ErrorView> exception(Exception e) {
ErrorView errorView = new ErrorView(e.getMessage());
HttpStatus status = computeStatusFromException(e);
if (status.is5xxServerError()) {
ResponseEntity<ErrorView> errorView = createErrorView(e);
if (errorView.getStatusCode().is5xxServerError()) {
logger.error(e.getMessage(), e);
}
return errorView;
}

public ResponseEntity<ErrorView> createErrorView(Exception e) {
ErrorView errorView = new ErrorView(e.getMessage());
HttpStatus status = computeStatusFromException(e);
return new ResponseEntity<>(errorView, status);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public Object logArroundExec(ProceedingJoinPoint pjp) throws Throwable {

@AfterThrowing(pointcut = POINTCUT, throwing = "e")
public void logAfterException(JoinPoint jp, Exception e) {
ResponseEntity<?> error = sugoiAdviceController.exception(e);
ResponseEntity<?> error = sugoiAdviceController.createErrorView(e);
if (log.isInfoEnabled())
log.info(
"type={} user={} requestArguments='{}' responseCode='{}' exception='{}'",
Expand Down