Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions adafruit_httpserver/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,16 @@ def __init__(self, path: str) -> None:
Creates a new ``FileNotExistsError`` for the file at ``path``.
"""
super().__init__(f"File does not exist: {path}")


class WebsocketError(Exception):
"""
Raised when there is a error in WebSocket communication.
"""

def __init__(self, message: str, code: int = None) -> None:
"""
Creates a new ``WebsocketError`` with the given ``message``.
"""
self.code = code
super().__init__(f"WebSocket error: {message}")
Loading