Skip to content

Commit c854b74

Browse files
committed
Improve error handling and code robustness: - Add proper timeout implementation - Fix text wrapping for string/list inputs - Improve TLDR source error handling - Add public save_cache method - Add custom exceptions module
1 parent 7642e5e commit c854b74

File tree

9 files changed

+688
-284
lines changed

9 files changed

+688
-284
lines changed

pydevcheat/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@
44

55
__version__ = "1.0.0"
66
__author__ = "Eliran Cohen"
7-
__email__ = "[email protected]"
7+
__email__ = "[email protected]"
8+
9+
from pydevcheat.main import PyDevCheat
10+
11+
__all__ = ["PyDevCheat"]

pydevcheat/exceptions.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
Custom exceptions for the PyDevCheat package.
3+
"""
4+
5+
class PyDevCheatError(Exception):
6+
"""Base exception for all PyDevCheat errors."""
7+
pass
8+
9+
class SourceError(PyDevCheatError):
10+
"""Exception raised when a source-specific error occurs."""
11+
pass
12+
13+
class NetworkError(PyDevCheatError):
14+
"""Exception raised when a network-related error occurs."""
15+
pass
16+
17+
class TimeoutError(PyDevCheatError):
18+
"""Exception raised when an operation times out."""
19+
pass

0 commit comments

Comments
 (0)