forked from WhyNotHugo/python-barcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.py
More file actions
executable file
·33 lines (20 loc) · 714 Bytes
/
Copy patherrors.py
File metadata and controls
executable file
·33 lines (20 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""barcode.errors
"""
__docformat__ = 'restructuredtext en'
class BarcodeError(Exception):
def __init__(self, msg):
self.msg = msg
def __str__(self):
return self.msg
class IllegalCharacterError(BarcodeError):
"""Raised when a barcode-string contains illegal characters."""
class BarcodeNotFoundError(BarcodeError):
"""Raised when an unknown barcode is requested."""
class NumberOfDigitsError(BarcodeError):
"""Raised when the number of digits do not match."""
class WrongCountryCodeError(BarcodeError):
"""Raised when a JAN (Japan Article Number) don't starts with 450-459
or 490-499.
"""