Browse Source

Quit out on error

Noah 8 years ago
parent
commit
4f3c2b08f8
1 changed files with 6 additions and 0 deletions
  1. 6 0
      client/index.js

+ 6 - 0
client/index.js View File

@@ -87,6 +87,8 @@ function poll(id) {
87 87
         if (result && result.status && result.status === "ready" && result.url) {
88 88
           video.update(result.url, preview.theme().name);
89 89
           setClass("rendered");
90
+        } else if (result.status === "error") {
91
+          error(result.error);
90 92
         } else {
91 93
           d3.select("#loading-message").text(statusMessage(result));
92 94
           poll(id);
@@ -108,6 +110,10 @@ function error(msg) {
108 110
     msg = JSON.stringify(msg);
109 111
   }
110 112
 
113
+  if (!msg) {
114
+    msg = "Unknown error";
115
+  }
116
+
111 117
   d3.select("#loading-message").text("Loading...");
112 118
   setClass("error", msg);
113 119