This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
devicehub-teal/ereuse_devicehub/resources/device/exceptions.py
2018-05-16 15:23:48 +02:00

15 lines
573 B
Python

from teal.marshmallow import ValidationError
class MismatchBetweenIds(ValidationError):
def __init__(self, other_device_id: int, field: str, value: str):
message = 'The device {} has the same {} than this one ({}).'.format(other_device_id,
field, value)
super().__init__(message, field_names=[field])
class NeedsId(ValidationError):
def __init__(self):
message = 'We couldn\'t get an ID for this device. Is this a custom PC?'
super().__init__(message)