exceptions_with_structure 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- exceptions_with_structure-1.0.0/.gitignore +4 -0
- exceptions_with_structure-1.0.0/PKG-INFO +11 -0
- exceptions_with_structure-1.0.0/README.md +0 -0
- exceptions_with_structure-1.0.0/pyproject.toml +38 -0
- exceptions_with_structure-1.0.0/src/py/__init__.py +12 -0
- exceptions_with_structure-1.0.0/src/py/utils.py +5 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: exceptions_with_structure
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A standardized error class with ISO-8601 timestamps and machine-readable codes.
|
|
5
|
+
Author-email: Vedansh Shetti <vedansh.shetti@gmail.com>
|
|
6
|
+
License: EUPL-1.2
|
|
7
|
+
Classifier: License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Typing :: Typed
|
|
11
|
+
Requires-Python: >=3.8
|
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "exceptions_with_structure"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = "A standardized error class with ISO-8601 timestamps and machine-readable codes."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.8"
|
|
7
|
+
license = { text = "EUPL-1.2" }
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "Vedansh Shetti", email = "vedansh.shetti@gmail.com" }
|
|
10
|
+
]
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Programming Language :: Python :: 3",
|
|
13
|
+
"License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)",
|
|
14
|
+
"Operating System :: OS Independent",
|
|
15
|
+
"Typing :: Typed",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
[build-system]
|
|
19
|
+
requires = ["hatchling"]
|
|
20
|
+
build-backend = "hatchling.build"
|
|
21
|
+
|
|
22
|
+
[tool.hatch.build.targets.wheel]
|
|
23
|
+
# Tells hatchling to look inside src/py for the package code
|
|
24
|
+
packages = ["src/py"]
|
|
25
|
+
|
|
26
|
+
[tool.hatch.build.targets.sdist]
|
|
27
|
+
include = [
|
|
28
|
+
"/src/py",
|
|
29
|
+
"/README.md",
|
|
30
|
+
"/LICENSE",
|
|
31
|
+
]
|
|
32
|
+
exclude = [
|
|
33
|
+
"/.git",
|
|
34
|
+
"/.gitignore",
|
|
35
|
+
"/dist",
|
|
36
|
+
"/build",
|
|
37
|
+
"/__pycache__",
|
|
38
|
+
]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from .utils import iso8601
|
|
2
|
+
|
|
3
|
+
class StructuredError(Exception):
|
|
4
|
+
def __init__(self, message: str, error_code: str):
|
|
5
|
+
# Pass the message to the parent Exception class
|
|
6
|
+
super().__init__(message)
|
|
7
|
+
|
|
8
|
+
# Store your custom fields
|
|
9
|
+
self.timestamp = iso8601()
|
|
10
|
+
self.error_code = error_code
|
|
11
|
+
|
|
12
|
+
__all__ = ["StructuredError"]
|