return fail when couldn't contact server
authorOwen Smith <owen@omsmith.ca>
Sat, 24 Nov 2012 03:56:59 +0000 (22:56 -0500)
committerOwen Smith <owen@omsmith.ca>
Sat, 24 Nov 2012 03:56:59 +0000 (22:56 -0500)
www/assets/js/client.js

index d28036c..0ae4fc2 100644 (file)
@@ -24,7 +24,11 @@ PosClientWrapper = function (authKey, serverLocation) {
                        }
                }
 
-               return _client.purchaseItems(_getAuthString(), cardData, upcs);
+               try {
+                       return _client.purchaseItems(_getAuthString(), cardData, upcs);
+               } catch (e) {
+                       return E_PURCHASE_STATUS['EPS_FAIL'];
+               }
        }
 
        try {