Skip to content

Commit

Permalink
🐛 Fixed HTTP error code for DeviceNotConnectedException from 400 to 409
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
  • Loading branch information
Coduz committed Jun 4, 2024
1 parent fc8ee20 commit fa7b88b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class DeviceNotConnectedExceptionMapper implements ExceptionMapper<Device
public Response toResponse(DeviceNotConnectedException managementRequestContentException) {
LOG.error("Device Not Connected", managementRequestContentException);
return Response
.status(Status.BAD_REQUEST)
.status(Status.CONFLICT)
.entity(new DeviceNotConnectedExceptionInfo(managementRequestContentException))
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected DeviceNotConnectedExceptionInfo() {
}

public DeviceNotConnectedExceptionInfo(DeviceNotConnectedException deviceNotConnectedException) {
super(Response.Status.BAD_REQUEST, deviceNotConnectedException.getCode(), deviceNotConnectedException);
super(Response.Status.CONFLICT, deviceNotConnectedException.getCode(), deviceNotConnectedException);

this.deviceId = deviceNotConnectedException.getDeviceId();
this.connectionStatus = deviceNotConnectedException.getCurrentConnectionStatus();
Expand Down

0 comments on commit fa7b88b

Please sign in to comment.