This repository has been archived by the owner on Jan 26, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,36 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2015-2019 Peter Magnusson <[email protected]> | ||
#pylint: disable=C0111 | ||
|
||
"""Various custom exceptions""" | ||
|
||
class CommunicationTimeout(Exception): | ||
def __init__(self, message, buf): | ||
super(CommunicationTimeout, self).__init__(message) | ||
self.buf = buf | ||
|
||
|
||
class BadResponseException(Exception): | ||
def __init__(self, message, expected, actual): | ||
message = message + ' expected:`%s` != actual: `%s`' % (expected, actual) | ||
super(BadResponseException, self).__init__(message) | ||
|
||
self.expected = expected | ||
self.actual = actual | ||
|
||
class NoAckException(Exception): | ||
pass | ||
|
||
class DeviceNotFoundException(Exception): | ||
pass | ||
|
||
class VerificationError(Exception): | ||
pass | ||
|
||
class PathLengthException(Exception): | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2015-2019 Peter Magnusson <[email protected]> | ||
# pylint: disable=C0111 | ||
|
||
"""Various custom exceptions""" | ||
|
||
|
||
class CommunicationTimeout(Exception): | ||
def __init__(self, message, buf): | ||
super(CommunicationTimeout, self).__init__(message) | ||
self.buf = buf | ||
|
||
|
||
class BadResponseException(Exception): | ||
def __init__(self, message, expected, actual): | ||
message = message + ' expected:`%s` != actual: `%s`' % (expected, actual) | ||
super(BadResponseException, self).__init__(message) | ||
|
||
self.expected = expected | ||
self.actual = actual | ||
|
||
|
||
class NoAckException(Exception): | ||
pass | ||
|
||
|
||
class DeviceNotFoundException(Exception): | ||
pass | ||
|
||
|
||
class VerificationError(Exception): | ||
pass | ||
|
||
|
||
class PathLengthException(Exception): | ||
pass |