fix there is no error on missing revision

This commit is contained in:
Mohamed Karray
2019-03-11 18:42:10 +01:00
parent 856f564c8d
commit 77fb869ce4
3 changed files with 17 additions and 5 deletions

View File

@@ -15,6 +15,9 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import java.io.IOException;
import static sonia.scm.ContextEntry.ContextBuilder.entity;
import static sonia.scm.NotFoundException.notFound;
public class SourceRootResource {
private final RepositoryServiceFactory serviceFactory;
@@ -62,7 +65,7 @@ public class SourceRootResource {
if (browserResult != null) {
return Response.ok(browserResultToFileObjectDtoMapper.map(browserResult, namespaceAndName)).build();
} else {
return Response.status(Response.Status.NOT_FOUND).build();
throw notFound(entity("sources", path).in(namespaceAndName));
}
}
}