Exceptions

Module escpos.exceptions

ESC/POS Exceptions classes

Result/Exit codes:

author:Manuel F Martinez and others
organization:Bashlinux and python-escpos
copyright:Copyright (c) 2012 Bashlinux
license:GNU GPL v3
exception escpos.exceptions.BarcodeCodeError(msg=u'')

Bases: escpos.exceptions.Error

No Barcode code was supplied.

No data for the barcode has been supplied in escpos.escpos.Escpos.barcode(). The returncode for this exception is 30.

exception escpos.exceptions.BarcodeSizeError(msg=u'')

Bases: escpos.exceptions.Error

Barcode size is out of range.

This exception indicates that the values for the barcode size are out of range. The size of the barcode has to be in the range that is specified in escpos.escpos.Escpos.barcode(). The resulting returncode is 20.

exception escpos.exceptions.BarcodeTypeError(msg=u'')

Bases: escpos.exceptions.Error

No Barcode type defined.

This exception indicates that no known barcode-type has been entered. The barcode-type has to be one of those specified in escpos.escpos.Escpos.barcode(). The returned error code is 10.

exception escpos.exceptions.CashDrawerError(msg=u'')

Bases: escpos.exceptions.Error

Valid pin must be set in order to send pulse.

A valid pin number has to be passed onto the method escpos.escpos.Escpos.cashdraw(). The returncode for this exception is 60.

exception escpos.exceptions.CharCodeError(msg=u'')

Bases: escpos.exceptions.Error

Valid char code must be set.

The supplied charcode-name in escpos.escpos.Escpos.charcode() is unknown. Ths returncode for this exception is 80.

exception escpos.exceptions.ConfigNotFoundError(msg=u'')

Bases: escpos.exceptions.Error

The configuration file was not found

The default or passed configuration file could not be read Ths returncode for this exception is 200.

exception escpos.exceptions.ConfigSectionMissingError(msg=u'')

Bases: escpos.exceptions.Error

The configuration file is missing a section

The part of the config asked for doesn’t exist in the loaded configuration Ths returncode for this exception is 220.

exception escpos.exceptions.ConfigSyntaxError(msg=u'')

Bases: escpos.exceptions.Error

The configuration file is invalid

The syntax is incorrect Ths returncode for this exception is 210.

exception escpos.exceptions.Error(msg, status=None)

Bases: exceptions.Exception

Base class for ESC/POS errors

exception escpos.exceptions.ImageSizeError(msg=u'')

Bases: escpos.exceptions.Error

Image height is longer than 255px and can’t be printed.

The returncode for this exception is 40.

exception escpos.exceptions.SetVariableError(msg=u'')

Bases: escpos.exceptions.Error

A set method variable was out of range

Check set variables against minimum and maximum values Ths returncode for this exception is 100.

exception escpos.exceptions.TabPosError(msg=u'')

Bases: escpos.exceptions.Error

Valid tab positions must be in the range 0 to 16.

This exception is raised by escpos.escpos.Escpos.control(). The returncode for this exception is 70.

exception escpos.exceptions.TextError(msg=u'')

Bases: escpos.exceptions.Error

Text string must be supplied to the text() method.

This exception is raised when an empty string is passed to escpos.escpos.Escpos.text(). The returncode for this exception is 50.

exception escpos.exceptions.USBNotFoundError(msg=u'')

Bases: escpos.exceptions.Error

Device wasn’t found (probably not plugged in)

The USB device seems to be not plugged in. Ths returncode for this exception is 90.