msgfy is a Python library for convert Exception instance to a human-readable error message.
Project description
msgfy
Summary
msgfy is a Python library for convert Exception instance to a human-readable error message.
Usage
- Sample Code:
import msgfy def main(): try: raise ValueError("example message") except ValueError as e: print(msgfy.to_error_message(e)) main()
- Output:
ValueError error_message_basic.py(19) main: example message
Specify message format
- Sample Code:
import msgfy def main(): try: raise ValueError("example message") except ValueError as e: print(msgfy.to_error_message(e, "{func_name}: {error_msg}")) main()
- Output:
main: example message
Available keywords for message formats
Keyword |
Replaced to |
---|---|
"{exception}" |
Exception class name |
"{file_name}" |
File name that exception raised |
"{line_no}" |
Line number where the exception raised |
"{func_name}" |
Function name that exception raised |
"{error_msg}" |
Message that passed to the exception instance |
Installation
pip install msgfy
Dependencies
Python 2.7+ or 3.4+
Test dependencies
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
msgfy-0.0.1.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for msgfy-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b560e566a2a24c6e4a8e84924eb8603a103fc9e62ff987b4e7974580558f4fa |
|
MD5 | d819331735205a2f499e8fd3506e5016 |
|
BLAKE2b-256 | eddf53a4527a6ad5ee95828aa6f94483df2885730e476ac81ec8c030d3f78c3f |