RED-5945: 500 when importing faulty archive
* now throwing a BadRequestException when archive is faulty
This commit is contained in:
parent
6ec370ad01
commit
bc8ca76858
@ -113,6 +113,9 @@ public class DossierTemplateImportService {
|
|||||||
public String importDossierTemplate(ImportDossierTemplateRequest request) {
|
public String importDossierTemplate(ImportDossierTemplateRequest request) {
|
||||||
|
|
||||||
ImportTemplateResult archiveResult = this.handleArchive(request);
|
ImportTemplateResult archiveResult = this.handleArchive(request);
|
||||||
|
if(archiveResult == null) {
|
||||||
|
throw new BadRequestException("The provided archive is faulty");
|
||||||
|
}
|
||||||
|
|
||||||
return this.importDossierTemplate(archiveResult);
|
return this.importDossierTemplate(archiveResult);
|
||||||
}
|
}
|
||||||
@ -280,6 +283,9 @@ public class DossierTemplateImportService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(importTemplateResult.getDossierTemplate() == null) {
|
||||||
|
throw new BadRequestException("Provided archive is faulty");
|
||||||
|
}
|
||||||
return importTemplateResult;
|
return importTemplateResult;
|
||||||
} finally {
|
} finally {
|
||||||
if (tempFile != null) {
|
if (tempFile != null) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user