Skip to content

Commit

Permalink
Add CommandFailed base class
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery committed Oct 16, 2023
1 parent e32a1a8 commit f0ddd07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions improv_ble_client/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class CharacteristicMissingError(Exception):
"""Raised when a characteristic is missing."""


class CommandFailed(ImprovError):
"""Raised when a command fails."""


class Disconnected(ImprovError):
"""Raised when the connection is lost."""

Expand All @@ -36,8 +40,8 @@ class NotConnected(ImprovError):
"""Raised when connection is lost while sending a command."""


class ProvisioningFailed(ImprovError):
"""Raised when the device rejects a command."""
class ProvisioningFailed(CommandFailed):
"""Raised when provisioning fails."""

def __init__(self, error: Error):
self.error = error
Expand Down

0 comments on commit f0ddd07

Please sign in to comment.