Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tristanpoland/shipwreck
A python library for error handling
https://github.com/tristanpoland/shipwreck
Last synced: 14 days ago
JSON representation
A python library for error handling
- Host: GitHub
- URL: https://github.com/tristanpoland/shipwreck
- Owner: tristanpoland
- License: apache-2.0
- Created: 2023-03-07T17:23:20.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-03T18:20:26.000Z (over 1 year ago)
- Last Synced: 2024-12-08T18:37:28.145Z (17 days ago)
- Language: Python
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Usage
To use Shipwreck, simply import the `Shipwreck` class and call its `handle_error` method with the exception that was raised:
```
from shipwreck import Shipwrecktry:
# Some code that might raise an exception
except Exception as e:
sw = Shipwreck()
sw.handle_error(e)
```The `handle_error` method will display a popup window with information about the error, including the error message, traceback, and any suggested fixes.
## Suggested Fixes
Shipwreck can automatically detect common types of errors and suggest fixes for them. For example:
- If an `AttributeError` is raised because a method or attribute is missing, Shipwreck will suggest checking the spelling of the method or attribute name.
- If an `ImportError` is raised because a module is missing, Shipwreck will suggest checking that the module is installed and accessible.
- If a `FileNotFoundError` is raised because a file is missing, Shipwreck will suggest checking that the file path is correct.
- If an `IndentationError` is raised because of incorrect indentation, Shipwreck will suggest checking the indentation of the code.Shipwreck can detect many other types of errors and provide suggested fixes for them. If you encounter an error that Shipwreck doesn't recognize, you can add a new error pattern and suggested fix by editing the `Shipwreck` class.