File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/main/java/com/target/devicemanager/common Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,17 @@ public DeviceAvailabilityResponse getDeviceAvailability() {
44
44
@ GetMapping ("/v1/deviceerror" )
45
45
public SseEmitter getDeviceError () throws IOException {
46
46
LOGGER .info ("GET : /v1/deviceerror" );
47
- SseEmitter sseEmitter = new SseEmitter (Long .MAX_VALUE );
48
- deviceAvailabilityService .subscribeToDeviceError (sseEmitter );
49
- return sseEmitter ;
47
+ try {
48
+ SseEmitter sseEmitter = new SseEmitter (Long .MAX_VALUE );
49
+ deviceAvailabilityService .subscribeToDeviceError (sseEmitter );
50
+ return sseEmitter ;
51
+ } catch (IOException ioException ) {
52
+ LOGGER .info ("IOException in DeviceError: " + ioException .getMessage ());
53
+ throw ioException ;
54
+ } catch (Exception exception ) {
55
+ LOGGER .info ("Exception in DeviceError: " + exception .getMessage ());
56
+ throw exception ;
57
+ }
50
58
}
51
59
52
60
@ Operation (description = "Health status of all devices" )
You can’t perform that action at this time.
0 commit comments