Report errors to user

No errors were being reported before.
Also add TODO for progress indicator on long uploads
This commit is contained in:
Tom Morris 2020-06-21 23:09:47 -04:00
parent 2977ffa167
commit 7a1451f561

View File

@ -68,6 +68,8 @@ public class UploadCommand extends Command {
private static final String METADATA_DESCRIPTION = "OpenRefine project dump";
private static final String METADATA_ICON_FILE = "logo-openrefine-550.png";
// TODO: We need a way to provide progress to the user during long uploads
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
@ -99,7 +101,8 @@ public class UploadCommand extends Command {
List<Exception> exceptions = new LinkedList<Exception>();
String url = upload(project, engine, params, token, name, exceptions);
if (url != null) {
// The URL can be non-null even if it doesn't fail
if (url != null && exceptions.size() == 0) {
writer.writeStringField("status", "ok");
writer.writeStringField("url", url);
} else if (exceptions.size() == 0) {