Commit 752c6c71 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when source file doesn't exist throw proper exception

parent 95e5faeb
......@@ -123,6 +123,9 @@ public class ProjectController extends BaseController {
public ResponseEntity<byte[]> getProjectSource(@PathVariable(value = "projectId") String projectId)
throws QueryException {
FileEntry file = projectController.getSource(projectId);
if (file == null) {
throw new ObjectNotFoundException("File doesn't exist");
}
MediaType type = MediaType.TEXT_PLAIN;
if (file.getOriginalFileName().endsWith("xml")) {
type = MediaType.APPLICATION_XML;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment