Pull request #160: RED-575: Error 500 if trying add-to-dictionary for a type/dictionary that does not exist

Merge in RED/persistence-service from RED-575-ps1 to master

* commit 'afc89e377383ebc056490ae6c5626f05434759bd':
  RED-575: Error 500 if trying add-to-dictionary for a type/dictionary that does not exist
This commit is contained in:
Ali Oezyetimoglu 2021-12-14 16:37:17 +01:00
commit f5cea99790

View File

@ -79,12 +79,10 @@ public class ManualRedactionService {
} }
dictionaryController.getDictionaryForType(addRedactionRequest.getTypeId()); dictionaryController.getDictionaryForType(addRedactionRequest.getTypeId());
} catch (FeignException e) { } catch (NotFoundException e) {
if (e.status() == 404) {
throw new BadRequestException("Invalid type: " + addRedactionRequest.getTypeId()); throw new BadRequestException("Invalid type: " + addRedactionRequest.getTypeId());
} }
} }
}
String annotationId = hashFunction.hashString(fileId + addRedactionRequest, StandardCharsets.UTF_8).toString(); String annotationId = hashFunction.hashString(fileId + addRedactionRequest, StandardCharsets.UTF_8).toString();
OffsetDateTime now = OffsetDateTime.now(); OffsetDateTime now = OffsetDateTime.now();