Commits

Shlomi Fish  committed 0575f97

Handle FCS_STATE_IS_NOT_SOLVEABLE gracefully.

  • Participants
  • Parent commits a7a0d24

Comments (0)

Files changed (5)

File fc-solve/site/wml/TODO.quicktask

 # Quicktask v1.2
 
 CURRENT TASKS:
-    - Fix "Unknown error code 1" in deal #11982 - http://xrl.us/bobiap
-        * Thanks to Ari for noting that.
-        * Added [Sat 2013-01-19]
     - Play with using http://twitter.github.com/bootstrap/ for the site.
         * in a separate git branch
         * Added [Sat 2013-01-12]
     - Convert src/js/web-fc-solve-ui.js to a Joose class.
         * Added [Fri 2013-01-18]
         * DONE [Fri 2013-01-18]
+    - Fix "Unknown error code 1" in deal #11982 - http://xrl.us/bobiap
+        * Thanks to Ari for noting that.
+        * Added [Sat 2013-01-19]
 
 
 # vim:ft=quicktask:sw=4:ts=4

File fc-solve/site/wml/lib/sass/web-fc-solve.sass

         color: blue
     &.solved
         color: green
-    &.exceeded
+    &.exceeded, &.impossible
         color: purple
     &.error
         color: red

File fc-solve/site/wml/src/js-fc-solve/text/index.html.wml

 </p>
 </li>
 
+<li>
+<p>
+<a href="mailto:ari.i.becker@gmail.com">Ari Becker</a> - tipped me regarding
+unsolvable deals.
+</p>
+</li>
+
 </ul>

File fc-solve/site/wml/src/js/web-fc-solve-ui.js

                 ctl.addClass(myclass);
                 ctl.html(escapeHtml(mylabel));
 
-                if (myclass == "exceeded") {
+                var is_exceed = (myclass == "exceeded");
+
+                if (is_exceed) {
                     that._was_iterations_count_exceeded = true;
+                }
+
+                if (is_exceed || (myclass == "impossible")) {
                     that._re_enable_output();
                 }
 

File fc-solve/site/wml/src/js/web-fc-solve.js

 
                  return;
              }
+             else if (solve_err_code == FCS_STATE_IS_NOT_SOLVEABLE) {
+
+                 that.set_status("impossible", "Could not solve.");
+
+                 return;
+             }
              else {
                  alert ("Unknown Error code " + solve_err_code + "!");
                  throw "Foo";