forked from s3lph/matemat
s3lph
f614fe1afc
fix: improve error handling on database consistency errors (e.g. non-unique ean codes) in the settings feat: handle ean codes in the already open tab via a websocket connection feat: populate ean code input field when a barcode is scanned while in the product settings
15 lines
336 B
Python
15 lines
336 B
Python
|
|
from typing import Optional
|
|
|
|
|
|
class DatabaseConsistencyError(Exception):
|
|
|
|
def __init__(self, msg: Optional[str] = None) -> None:
|
|
self._msg: Optional[str] = msg
|
|
|
|
def __str__(self) -> str:
|
|
return f'DatabaseConsistencyError: {self._msg}'
|
|
|
|
@property
|
|
def msg(self) -> Optional[str]:
|
|
return self._msg
|