RED-7158: even more specific error messages #92
@ -25,7 +25,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.iqser.red.service.persistence.management.v1.processor.client.pdftronredactionservice.PDFTronClient;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.exception.BadRequestException;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.exception.InternalServerErrorException;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.exception.NotAllowedException;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.exception.NotFoundException;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.AccessControlService;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.FileManagementStorageService;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.FileService;
|
||||
@ -148,10 +150,10 @@ public class FileManagementController implements FileManagementResource {
|
||||
var pdfFileStream = fileManagementStorageService.getObject(TenantContext.getTenantId(), storageId);
|
||||
return getResponseEntity(inline, pdfFileStream, file.getFilename());
|
||||
} catch (StorageObjectDoesNotExist e) {
|
||||
return new ResponseEntity<>(String.format("File \"%s\" not found!, the dossier with ID \"%s\" probably does not exist.", storageId, dossierId), HttpStatus.NOT_FOUND);
|
||||
throw new NotFoundException(String.format("File \"%s\" not found!, the dossier with ID \"%s\" probably does not exist.", storageId, dossierId));
|
||||
} catch (StorageException e) {
|
||||
log.debug(e.getMessage(), e);
|
||||
return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
throw new InternalServerErrorException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user