-
-
Notifications
You must be signed in to change notification settings - Fork 134
Expand file tree
/
Copy patherrors.py
More file actions
executable file
·31 lines (18 loc) · 699 Bytes
/
errors.py
File metadata and controls
executable file
·31 lines (18 loc) · 699 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
"""barcode.errors"""
from __future__ import annotations
__docformat__ = "restructuredtext en"
class BarcodeError(Exception):
def __init__(self, msg) -> None:
self.msg = msg
def __str__(self) -> str:
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.
"""