-
Bug
-
Resolution: Done
-
Medium
-
Jakarta Release
-
None
- DMI expects the status code to 201 created , if it is other than that then it will result in exception (which will be handled by our exception handler and would result in 500 INTERNAL_SERVER_ERROR.
Code from DmiServiceImpl (DMI plugin) Existing
final ResponseEntity<String> responseEntity = ncmpRestClient.registerCmHandlesWithNcmp(cmHandlesJson); if ((responseEntity.getStatusCode() != HttpStatus.CREATED)) { throw new CmHandleRegistrationException(responseEntity.getBody()); } So as per the high-level discussion we had we can check for *2XX* code (like below) *Proposed change* \|final ResponseEntity<String> responseEntity = ncmpRestClient.registerCmHandlesWithNcmp(cmHandlesJson); if *((!responseEntity.getStatusCode().is2xxSuccessful()))* \{ throw new CmHandleRegistrationException(responseEntity.getBody()); }
|