Commit b73a16aa authored by Eirik Alvær's avatar Eirik Alvær

Fixes #2066. Better error message for download functionality.

parent b2e17dbc
......@@ -10,6 +10,7 @@ import com.nesstar.rest.common.ServerHandler;
import com.nesstar.rest.common.Operation;
import com.nesstar.rest.common.OperationRunner;
import com.nesstar.rest.common.ResourceExtractor;
import com.nesstar.rest.result_object_makers.ErrorMaker;
import com.yammer.metrics.annotation.Timed;
import javax.servlet.http.HttpServletRequest;
......@@ -50,6 +51,9 @@ public final class DownloadResource extends AbstractResource {
subset = CaseSubset.compile(caseSubset, server);
}
if (fileFormat == null) {
return ErrorMaker.getBadRequestError("The request must specify a file format.");
}
FileFormat format = FileFormat.valueOf(fileFormat);
ResultStream stream = study.download(format, subset, variables.toArray(new Variable[variables.size()]));
......
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