Exception Handling; Steps For Handling - Epson TM-T88V User Manual

Epos-print sdk for android
Hide thumbs Also See for TM-T88V:
Table of Contents

Advertisement

Exception handling

In ePOS-Print SDK for Android, it is designed that when an error occurs, a propriety exception with an integer
(int) type parameter is generated to notify the calling side of such an error. The ePOS-Print API acquires
information using the
EposException class
(p.40). The following errors are sent:
Type
Error status
Printer status

Steps for Handling

ePOS-Print API
Acquire the error status using
using
getPrinterStatus (p.94)
//<Send data for confirmation>
Print printer = new Print();
int[] status = new int[1];
status[0] = 0;
try {
//Create a print document
Builder builder = new Builder("TM-T88V", Builder.MODEL_ANK);
builder.addText("Hello,\t");
builder.addText("World!\n");
builder.addCut(Builder.CUT_FEED);
//<Send print data>
printer.openPrinter(Print.DEVTYPE_TCP, "192.168.192.168");
printer.sendData(builder, 10000, status);
printer.closePrinter();
} catch (EposException e) {
//Acquire the error status
int errStatus = e.getErrorStatus();
//Acquire the printer status
status[0] = e.getPrinterStatus();
printer.closePrinter();
}
34
EposException class
(p.40), and the search API acquires information using the
Cause of error when each class's API was executed. 
For details, refer to
Status of the printer when print data was sent. 
The printer status can be acquired only when
executed.
For details, refer to
getErrorStatus (p.93)
of that class. Use the programming example below for your reference.
Description
Error Status List
(p.36).
Printer Status List
(p.37).
of the EposException class, and acquire the printer status
sendData (p.91)
is

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tm-t70Tm-p60Tm-u220

Table of Contents