orionis 0.493.0__py3-none-any.whl → 0.494.0__py3-none-any.whl
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.
- orionis/failure/base/handler.py +25 -0
- orionis/failure/catch.py +4 -0
- orionis/failure/contracts/handler.py +39 -0
- orionis/metadata/framework.py +1 -1
- {orionis-0.493.0.dist-info → orionis-0.494.0.dist-info}/METADATA +1 -1
- {orionis-0.493.0.dist-info → orionis-0.494.0.dist-info}/RECORD +10 -10
- {orionis-0.493.0.dist-info → orionis-0.494.0.dist-info}/WHEEL +0 -0
- {orionis-0.493.0.dist-info → orionis-0.494.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.493.0.dist-info → orionis-0.494.0.dist-info}/top_level.txt +0 -0
- {orionis-0.493.0.dist-info → orionis-0.494.0.dist-info}/zip-safe +0 -0
orionis/failure/base/handler.py
CHANGED
|
@@ -40,6 +40,31 @@ class BaseExceptionHandler(IBaseExceptionHandler):
|
|
|
40
40
|
traceback=getattr(e, '__traceback__', None) # The traceback object, if available
|
|
41
41
|
)
|
|
42
42
|
|
|
43
|
+
def shouldIgnoreException(self, e: BaseException) -> bool:
|
|
44
|
+
"""
|
|
45
|
+
Determines if the exception should be ignored (not handled) by the handler.
|
|
46
|
+
|
|
47
|
+
Parameters
|
|
48
|
+
----------
|
|
49
|
+
e : BaseException
|
|
50
|
+
The exception instance to check.
|
|
51
|
+
|
|
52
|
+
Returns
|
|
53
|
+
-------
|
|
54
|
+
bool
|
|
55
|
+
True if the exception should be ignored, False otherwise.
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
# Ensure the provided object is an exception
|
|
59
|
+
if not isinstance(e, BaseException):
|
|
60
|
+
raise TypeError(f"Expected BaseException, got {type(e).__name__}")
|
|
61
|
+
|
|
62
|
+
# Convert the exception into a structured Throwable object
|
|
63
|
+
throwable = self.destructureException(e)
|
|
64
|
+
|
|
65
|
+
# Check if the exception type is in the list of exceptions to ignore
|
|
66
|
+
return hasattr(self, 'dont_cathc') and throwable.classtype in self.dont_cathc
|
|
67
|
+
|
|
43
68
|
def report (self, exception: BaseException, log: ILogger) -> Any:
|
|
44
69
|
"""
|
|
45
70
|
Report or log an exception.
|
orionis/failure/catch.py
CHANGED
|
@@ -77,6 +77,10 @@ class Catch(ICatch):
|
|
|
77
77
|
If a valid kernel is provided, the exception details are rendered to the CLI.
|
|
78
78
|
"""
|
|
79
79
|
|
|
80
|
+
# Check if the exception should be ignored by the handler
|
|
81
|
+
if self.__exception_handler.shouldIgnoreException(e):
|
|
82
|
+
return
|
|
83
|
+
|
|
80
84
|
# Report the exception using the application's exception handler and logger
|
|
81
85
|
self.__exception_handler.report(
|
|
82
86
|
exception=e,
|
|
@@ -5,6 +5,45 @@ from orionis.services.log.contracts.log_service import ILogger
|
|
|
5
5
|
|
|
6
6
|
class IBaseExceptionHandler:
|
|
7
7
|
|
|
8
|
+
@abstractmethod
|
|
9
|
+
def destructureException(self, e: BaseException):
|
|
10
|
+
"""
|
|
11
|
+
Converts an exception into a structured `Throwable` object containing detailed information.
|
|
12
|
+
|
|
13
|
+
Parameters
|
|
14
|
+
----------
|
|
15
|
+
e : BaseException
|
|
16
|
+
The exception instance to be destructured.
|
|
17
|
+
|
|
18
|
+
Returns
|
|
19
|
+
-------
|
|
20
|
+
Throwable
|
|
21
|
+
A `Throwable` object encapsulating the exception's class type, message, arguments, and traceback.
|
|
22
|
+
|
|
23
|
+
Notes
|
|
24
|
+
-----
|
|
25
|
+
This method extracts the type, message, arguments, and traceback from the provided exception
|
|
26
|
+
and wraps them in a `Throwable` object for consistent error handling and reporting.
|
|
27
|
+
"""
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
@abstractmethod
|
|
31
|
+
def shouldIgnoreException(self, e: BaseException) -> bool:
|
|
32
|
+
"""
|
|
33
|
+
Determines if the exception should be ignored (not handled) by the handler.
|
|
34
|
+
|
|
35
|
+
Parameters
|
|
36
|
+
----------
|
|
37
|
+
e : BaseException
|
|
38
|
+
The exception instance to check.
|
|
39
|
+
|
|
40
|
+
Returns
|
|
41
|
+
-------
|
|
42
|
+
bool
|
|
43
|
+
True if the exception should be ignored, False otherwise.
|
|
44
|
+
"""
|
|
45
|
+
pass
|
|
46
|
+
|
|
8
47
|
@abstractmethod
|
|
9
48
|
def report (self, exception: BaseException, log: ILogger) -> Any:
|
|
10
49
|
"""
|
orionis/metadata/framework.py
CHANGED
|
@@ -93,12 +93,12 @@ orionis/container/validators/is_subclass.py,sha256=4sBaGLoRs8nUhuWjlP0VJqyTwVHYq
|
|
|
93
93
|
orionis/container/validators/is_valid_alias.py,sha256=4uAYcq8xov7jZbXnpKpjNkxcZtlTNnL5RRctVPMwJes,1424
|
|
94
94
|
orionis/container/validators/lifetime.py,sha256=IQ43fDNrxYHMlZH2zlYDJnlkLO_eS4U7Fs3UJgQBidI,1844
|
|
95
95
|
orionis/failure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
96
|
-
orionis/failure/catch.py,sha256=
|
|
96
|
+
orionis/failure/catch.py,sha256=1-G1U4Udzkd6QSmQ9oKQeUaFjosA9hNfzwmOWVIbUZU,3760
|
|
97
97
|
orionis/failure/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
98
|
-
orionis/failure/base/handler.py,sha256
|
|
98
|
+
orionis/failure/base/handler.py,sha256=1LDcJO4-tgam225jWT0lbh4VzqRSu5iOtcH5JSkMugk,4845
|
|
99
99
|
orionis/failure/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
100
100
|
orionis/failure/contracts/catch.py,sha256=e2wM1p6VxbvAjgWm-MwoM9p2ystSsyBu8Qnt6Ehr6Vc,1179
|
|
101
|
-
orionis/failure/contracts/handler.py,sha256=
|
|
101
|
+
orionis/failure/contracts/handler.py,sha256=1WyFx7D9h5chNnOXDQhg6o-RqNfhTHblm_xWzCDu4SM,2161
|
|
102
102
|
orionis/failure/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
103
103
|
orionis/failure/entities/throwable.py,sha256=ogys062uhim5QMYU62ezlnumRAnYQlUf_vZvQY47S3U,1227
|
|
104
104
|
orionis/foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -217,7 +217,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=72SoixFog9IOE9Ve9Xcfw6
|
|
|
217
217
|
orionis/foundation/providers/testing_provider.py,sha256=SrJRpdvcblx9WvX7x9Y3zc7OQfiTf7la0HAJrm2ESlE,3725
|
|
218
218
|
orionis/foundation/providers/workers_provider.py,sha256=oa_2NIDH6UxZrtuGkkoo_zEoNIMGgJ46vg5CCgAm7wI,3926
|
|
219
219
|
orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
220
|
-
orionis/metadata/framework.py,sha256=
|
|
220
|
+
orionis/metadata/framework.py,sha256=JVYrHvNcvIwP-Tu8ZDFmAKPmem6M2lZLP-0c-5oXNp4,4109
|
|
221
221
|
orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
|
|
222
222
|
orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
223
223
|
orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -391,7 +391,7 @@ orionis/test/validators/web_report.py,sha256=n9BfzOZz6aEiNTypXcwuWbFRG0OdHNSmCNu
|
|
|
391
391
|
orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnIfJYgc,1206
|
|
392
392
|
orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
393
393
|
orionis/test/view/render.py,sha256=f-zNhtKSg9R5Njqujbg2l2amAs2-mRVESneLIkWOZjU,4082
|
|
394
|
-
orionis-0.
|
|
394
|
+
orionis-0.494.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
|
|
395
395
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
396
396
|
tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
397
397
|
tests/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -538,8 +538,8 @@ tests/testing/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
538
538
|
tests/testing/validators/test_testing_validators.py,sha256=WPo5GxTP6xE-Dw3X1vZoqOMpb6HhokjNSbgDsDRDvy4,16588
|
|
539
539
|
tests/testing/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
540
540
|
tests/testing/view/test_render.py,sha256=tnnMBwS0iKUIbogLvu-7Rii50G6Koddp3XT4wgdFEYM,1050
|
|
541
|
-
orionis-0.
|
|
542
|
-
orionis-0.
|
|
543
|
-
orionis-0.
|
|
544
|
-
orionis-0.
|
|
545
|
-
orionis-0.
|
|
541
|
+
orionis-0.494.0.dist-info/METADATA,sha256=28lRMV-BoMpK4RrqgQVimRte_0zXTJS3W37ZJ6obyuc,4801
|
|
542
|
+
orionis-0.494.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
543
|
+
orionis-0.494.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
|
544
|
+
orionis-0.494.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
545
|
+
orionis-0.494.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|