• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

torresj / infosas-api / 87

12 Jan 2026 02:35PM UTC coverage: 76.32% (-15.3%) from 91.648%
87

push

circleci

torresj
Auth API added

70 of 170 new or added lines in 20 files covered. (41.18%)

477 of 625 relevant lines covered (76.32%)

0.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

54.55
/src/main/java/com/torresj/infosas/exceptions/GlobalExceptionHandler.java
1
package com.torresj.infosas.exceptions;
2

3
import lombok.extern.slf4j.Slf4j;
4
import org.springframework.http.HttpStatus;
5
import org.springframework.http.ProblemDetail;
6
import org.springframework.web.bind.annotation.ControllerAdvice;
7
import org.springframework.web.bind.annotation.ExceptionHandler;
8
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
9

10
@ControllerAdvice
11
@Slf4j
1✔
12
public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
1✔
13
    @ExceptionHandler(StaffNotFoundException.class)
14
    ProblemDetail handleStaffNotFound(StaffNotFoundException e) {
15
        ProblemDetail problemDetail =
1✔
16
                ProblemDetail.forStatusAndDetail(HttpStatus.NOT_FOUND, e.getMessage());
1✔
17
        problemDetail.setTitle(e.getMessage());
1✔
18
        log.error(e.toString());
1✔
19
        return problemDetail;
1✔
20
    }
21

22
    @ExceptionHandler(BadRequestException.class)
23
    ProblemDetail handleBadRequestException(BadRequestException e) {
24
        ProblemDetail problemDetail =
1✔
25
                ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, e.getMessage());
1✔
26
        problemDetail.setTitle(e.getMessage());
1✔
27
        log.error(e.toString());
1✔
28
        return problemDetail;
1✔
29
    }
30

31
    @ExceptionHandler(InfoSasAuthenticationException.class)
32
    ProblemDetail handleInfoSasAuthenticationException(InfoSasAuthenticationException e) {
NEW
33
        ProblemDetail problemDetail =
×
NEW
34
                ProblemDetail.forStatusAndDetail(HttpStatus.UNAUTHORIZED, e.getMessage());
×
NEW
35
        problemDetail.setTitle(e.getMessage());
×
NEW
36
        log.error(e.toString());
×
NEW
37
        return problemDetail;
×
38
    }
39

40
    @ExceptionHandler(ClientNotFoundException.class)
41
    ProblemDetail handleClientNotFoundExceptionException(ClientNotFoundException e) {
NEW
42
        ProblemDetail problemDetail =
×
NEW
43
                ProblemDetail.forStatusAndDetail(HttpStatus.NOT_FOUND, e.getMessage());
×
NEW
44
        problemDetail.setTitle(e.getMessage());
×
NEW
45
        log.error(e.toString());
×
NEW
46
        return problemDetail;
×
47
    }
48
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc