You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2009/11/11 08:50:57 UTC

svn commit: r834793 - /ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java

Author: jleroux
Date: Wed Nov 11 07:50:56 2009
New Revision: 834793

URL: http://svn.apache.org/viewvc?rev=834793&view=rev
Log:
Some better log info. Related to OFBIZ-487 which was actually already in.

Modified:
    ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java

Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java?rev=834793&r1=834792&r2=834793&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java (original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java Wed Nov 11 07:50:56 2009
@@ -112,13 +112,15 @@
     }
 
     public synchronized void printReport(PosTransaction trans, String resource, Map<String, String> context) {
+        // transaction mode causes all output to be buffered
         try {
             ((POSPrinter) control).transactionPrint(POSPrinterConst.PTR_S_RECEIPT, POSPrinterConst.PTR_TP_TRANSACTION);
-        } catch (Exception e) {
+        } catch (JposException e) {
+            Debug.logError(e, "Exception while setting jpos.POSPrinter.transactionPrint to transaction mode ", module);
         }
         Debug.log("Print Report Requested", module);
         String[] report = this.readReportTemplate(resource);
-
+        
         if (report != null) {
             for (int i = 0; i < report.length; i++) {
                 if (report[i] != null) {
@@ -132,7 +134,8 @@
         }
         try {
             ((POSPrinter) control).transactionPrint(POSPrinterConst.PTR_S_RECEIPT, POSPrinterConst.PTR_TP_NORMAL);
-        } catch (Exception e) {
+        } catch (JposException e) {
+            Debug.logError(e, "Exception while setting jpos.POSPrinter.transactionPrint to normal mode ", module);
         }
     }
 
@@ -170,6 +173,7 @@
                 try {
                     Thread.sleep(3000);
                 } catch (Exception e) {
+                    Debug.logError(e, module);
                 }
             }
         }
@@ -180,9 +184,11 @@
     }
 
     private void printReceipt(PosTransaction trans, String[] template, int type, Map<String, Object> payInfo) {
+        // transaction mode causes all output to be buffered
         try {
             ((POSPrinter) control).transactionPrint(POSPrinterConst.PTR_S_RECEIPT, POSPrinterConst.PTR_TP_TRANSACTION);
-        } catch (Exception e) {
+        } catch (JposException e) {
+            Debug.logError(e, "Exception while setting jpos.POSPrinter.transactionPrint to transaction mode ", module);
         }
 
         if (template != null) {
@@ -208,7 +214,8 @@
         }
         try {
             ((POSPrinter) control).transactionPrint(POSPrinterConst.PTR_S_RECEIPT, POSPrinterConst.PTR_TP_NORMAL);
-        } catch (Exception e) {
+        } catch (JposException e) {
+            Debug.logError(e, "Exception while setting jpos.POSPrinter.transactionPrint to normal mode ", module);
         }
     }