orionis 0.492.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.
@@ -27,15 +27,9 @@ class BaseScheduler(IBaseScheduler):
27
27
  None
28
28
  This method does not return any value. It is intended to be overridden
29
29
  by subclasses to specify scheduled tasks.
30
-
31
- Notes
32
- -----
33
- Subclasses should implement this method to add specific tasks to the scheduler
34
- using the provided `schedule` object. This method enforces that each subclass
35
- defines its own scheduled tasks.
36
30
  """
37
- # Raise an error to enforce implementation in subclasses
38
- raise NotImplementedError("The 'tasks' method must be implemented in the subclass.")
31
+ # Placeholder for task registration logic
32
+ pass
39
33
 
40
34
  def onStarted(self):
41
35
  """
orionis/console/kernel.py CHANGED
@@ -103,8 +103,7 @@ class KernelCLI(IKernelCLI):
103
103
  except BaseException as e:
104
104
 
105
105
  # Catch any exceptions that occur during command handling
106
- self.__catch.report(e)
107
- self.__catch.renderCLI(args, e)
106
+ self.__catch.exception(self, args, e)
108
107
 
109
108
  # Exit the process with a non-zero status code to indicate an error
110
109
  sys.exit(1)
@@ -0,0 +1,128 @@
1
+ from typing import Any, List
2
+ from orionis.console.output.contracts.console import IConsole
3
+ from orionis.failure.contracts.handler import IBaseExceptionHandler
4
+ from orionis.failure.entities.throwable import Throwable
5
+ from orionis.services.log.contracts.log_service import ILogger
6
+
7
+ class BaseExceptionHandler(IBaseExceptionHandler):
8
+
9
+ # Exceptions that should not be caught by the handler
10
+ dont_cathc: List[type[BaseException]] = [
11
+ # Add specific exceptions that should not be caught
12
+ # Example: OrionisContainerException
13
+ ]
14
+
15
+ def destructureException(self, e: BaseException) -> Throwable:
16
+ """
17
+ Converts an exception into a structured `Throwable` object containing detailed information.
18
+
19
+ Parameters
20
+ ----------
21
+ e : BaseException
22
+ The exception instance to be destructured.
23
+
24
+ Returns
25
+ -------
26
+ Throwable
27
+ A `Throwable` object encapsulating the exception's class type, message, arguments, and traceback.
28
+
29
+ Notes
30
+ -----
31
+ This method extracts the type, message, arguments, and traceback from the provided exception
32
+ and wraps them in a `Throwable` object for consistent error handling and reporting.
33
+ """
34
+
35
+ # Create and return a Throwable object with detailed exception information
36
+ return Throwable(
37
+ classtype=type(e), # The class/type of the exception
38
+ message=str(e), # The exception message as a string
39
+ args=e.args, # The arguments passed to the exception
40
+ traceback=getattr(e, '__traceback__', None) # The traceback object, if available
41
+ )
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
+
68
+ def report (self, exception: BaseException, log: ILogger) -> Any:
69
+ """
70
+ Report or log an exception.
71
+
72
+ Parameters
73
+ ----------
74
+ exception : BaseException
75
+ The exception instance that was caught.
76
+
77
+ Returns
78
+ -------
79
+ None
80
+ """
81
+ # Ensure the provided object is an exception
82
+ if not isinstance(exception, BaseException):
83
+ raise TypeError(f"Expected BaseException, got {type(exception).__name__}")
84
+
85
+ # Convert the exception into a structured Throwable object
86
+ throwable = self.destructureException(exception)
87
+
88
+ # If the exception type is in the list of exceptions passed to the handler
89
+ if hasattr(self, 'dont_cathc') and throwable.classtype in self.dont_cathc:
90
+ return
91
+
92
+ # Log the exception details
93
+ log.error(f"[{throwable.classtype.__name__}] {throwable.message}")
94
+
95
+ # Return the structured exception
96
+ return throwable
97
+
98
+ def renderCLI(self, args: List[str], exception: BaseException, log: ILogger, console: IConsole) -> Any:
99
+ """
100
+ Render the exception message for CLI output.
101
+
102
+ Parameters
103
+ ----------
104
+ exception : BaseException
105
+ The exception instance that was caught.
106
+
107
+ Returns
108
+ -------
109
+ None
110
+ """
111
+ # Ensure the provided object is an exception
112
+ if not isinstance(exception, BaseException):
113
+ raise TypeError(f"Expected BaseException, got {type(exception).__name__}")
114
+
115
+ # Convert the exception into a structured Throwable object
116
+ throwable = self.destructureException(exception)
117
+
118
+ # If the exception type is in the list of exceptions passed to the handler
119
+ if hasattr(self, 'dont_cathc') and throwable.classtype in self.dont_cathc:
120
+ return
121
+
122
+ # Log the CLI error message with arguments
123
+ log.error(f"CLI Error: {throwable.message} (Args: {args})")
124
+
125
+ # Output the exception traceback to the console
126
+ console.newLine()
127
+ console.exception(exception)
128
+ console.newLine()
orionis/failure/catch.py CHANGED
@@ -1,7 +1,8 @@
1
1
  from typing import Any, List
2
+ from orionis.console.kernel import KernelCLI
2
3
  from orionis.console.output.contracts.console import IConsole
3
4
  from orionis.failure.contracts.catch import ICatch
4
- from orionis.failure.entities.throwable import Throwable
5
+ from orionis.failure.contracts.handler import IBaseExceptionHandler
5
6
  from orionis.foundation.contracts.application import IApplication
6
7
  from orionis.services.log.contracts.log_service import ILogger
7
8
 
@@ -41,123 +42,56 @@ class Catch(ICatch):
41
42
  """
42
43
 
43
44
  # Retrieve the console output service from the application container
44
- self.console: IConsole = app.make('x-orionis.console.output.console')
45
+ self.__console: IConsole = app.make('x-orionis.console.output.console')
45
46
 
46
47
  # Retrieve the logger service from the application container
47
- self.logger: ILogger = app.make('x-orionis.services.log.log_service')
48
+ self.__logger: ILogger = app.make('x-orionis.services.log.log_service')
48
49
 
49
- def destructureException(self, e: BaseException) -> Throwable:
50
- """
51
- Converts an exception into a structured `Throwable` object containing detailed information.
52
-
53
- Parameters
54
- ----------
55
- e : BaseException
56
- The exception instance to be destructured.
57
-
58
- Returns
59
- -------
60
- Throwable
61
- A `Throwable` object encapsulating the exception's class type, message, arguments, and traceback.
62
-
63
- Notes
64
- -----
65
- This method extracts the type, message, arguments, and traceback from the provided exception
66
- and wraps them in a `Throwable` object for consistent error handling and reporting.
67
- """
68
-
69
- # Create and return a Throwable object with detailed exception information
70
- return Throwable(
71
- classtype=type(e), # The class/type of the exception
72
- message=str(e), # The exception message as a string
73
- args=e.args, # The arguments passed to the exception
74
- traceback=getattr(e, '__traceback__', None) # The traceback object, if available
75
- )
76
-
77
- def report(self, exception: BaseException) -> Any:
78
- """
79
- Logs and returns a destructured representation of an exception.
80
-
81
- Parameters
82
- ----------
83
- exception : BaseException
84
- The exception instance to be reported.
85
-
86
- Returns
87
- -------
88
- Throwable
89
- A destructured representation of the exception, containing its type, message, arguments, and traceback.
90
-
91
- Raises
92
- ------
93
- TypeError
94
- If the provided exception is not an instance of BaseException.
50
+ # Retrieve the console output service from the application container
51
+ self.__exception_handler: IBaseExceptionHandler = app.getExceptionHandler()
95
52
 
96
- Notes
97
- -----
98
- This method logs the exception details using the configured logger and returns a structured
99
- representation of the exception for further processing.
53
+ def exception(self, kernel: Any, request: Any, e: BaseException) -> None:
100
54
  """
55
+ Handles and reports exceptions that occur during CLI execution.
101
56
 
102
- # Ensure the provided object is an exception
103
- if not isinstance(exception, BaseException):
104
- raise TypeError(f"Expected BaseException, got {type(exception).__name__}")
105
-
106
- # Convert the exception into a structured Throwable object
107
- throwable = self.destructureException(exception)
108
-
109
- # If the exception type is in the list of exceptions passed to the handler
110
- if hasattr(self, 'dont_cathc') and throwable.classtype in self.dont_cathc:
111
- return
112
-
113
- # Log the exception details
114
- self.logger.error(f"[{throwable.classtype.__name__}] {throwable.message}")
115
-
116
- # Return the structured exception
117
- return throwable
118
-
119
- def renderCLI(self, args: List[str], exception: BaseException) -> Any:
120
- """
121
- Renders a CLI-friendly error message for a given exception.
57
+ This method reports the provided exception using the application's exception handler and logger.
58
+ If a kernel instance is provided, it also renders the exception details to the CLI for user visibility.
122
59
 
123
60
  Parameters
124
61
  ----------
125
- args : list
126
- The list of command-line arguments that were passed to the CLI.
127
- exception : BaseException
128
- The exception instance to be rendered.
62
+ kernel : Any
63
+ The kernel instance associated with the CLI, or None if not available.
64
+ request : Any
65
+ The request or arguments associated with the CLI command.
66
+ e : BaseException
67
+ The exception instance to be handled.
129
68
 
130
69
  Returns
131
70
  -------
132
71
  None
133
- This method does not return any value.
134
-
135
- Raises
136
- ------
137
- TypeError
138
- If the provided exception is not an instance of BaseException.
72
+ This method does not return any value. It performs side effects such as logging and output.
139
73
 
140
74
  Notes
141
75
  -----
142
- This method logs the error message using the configured logger and outputs
143
- the exception traceback to the console for user visibility.
76
+ The exception is always reported using the exception handler and logger.
77
+ If a valid kernel is provided, the exception details are rendered to the CLI.
144
78
  """
145
79
 
146
- # Ensure the provided object is an exception
147
- if not isinstance(exception, BaseException):
148
- raise TypeError(f"Expected BaseException, got {type(exception).__name__}")
149
-
150
- # Convert the exception into a structured Throwable object
151
- throwable = self.destructureException(exception)
152
-
153
- # If the exception type is in the list of exceptions passed to the handler
154
- if hasattr(self, 'dont_cathc') and throwable.classtype in self.dont_cathc:
80
+ # Check if the exception should be ignored by the handler
81
+ if self.__exception_handler.shouldIgnoreException(e):
155
82
  return
156
83
 
157
- # Log the CLI error message with arguments
158
- self.logger.error(f"CLI Error: {throwable.message} (Args: {args})")
84
+ # Report the exception using the application's exception handler and logger
85
+ self.__exception_handler.report(
86
+ exception=e,
87
+ log=self.__logger
88
+ )
159
89
 
160
- # Output the exception traceback to the console
161
- self.console.newLine()
162
- self.console.exception(exception)
163
- self.console.newLine()
90
+ # If a kernel is provided, render the exception details to the CLI
91
+ if isinstance(kernel, KernelCLI):
92
+ return self.__exception_handler.renderCLI(
93
+ args=request,
94
+ exception=e,
95
+ log=self.__logger,
96
+ console=self.__console
97
+ )
@@ -1,91 +1,32 @@
1
1
  from abc import ABC, abstractmethod
2
- from typing import Any, List
3
- from orionis.foundation.contracts.application import IApplication
2
+ from typing import Any
4
3
 
5
4
  class ICatch(ABC):
6
5
 
7
6
  @abstractmethod
8
- def __init__(self, app: IApplication) -> None:
7
+ def exception(self, kernel: Any, request: Any, e: BaseException) -> None:
9
8
  """
10
- Initializes the Catch handler with application services for console output and logging.
9
+ Handles and reports exceptions that occur during CLI execution.
11
10
 
12
- Parameters
13
- ----------
14
- app : IApplication
15
- The application instance used to resolve required services.
16
-
17
- Attributes
18
- ----------
19
- console : IConsole
20
- Console output service obtained from the application for displaying messages and exceptions.
21
- logger : ILogger
22
- Logger service obtained from the application for logging errors and exceptions.
23
-
24
- Returns
25
- -------
26
- None
27
- This constructor does not return any value.
28
-
29
- Notes
30
- -----
31
- The constructor retrieves the console and logger services from the application container
32
- using their respective service keys. These services are used throughout the class for
33
- error reporting and output.
34
- """
35
- pass
36
-
37
- @abstractmethod
38
- def report(self, exception: BaseException) -> Any:
39
- """
40
- Logs and returns a destructured representation of an exception.
11
+ This method reports the provided exception using the application's exception handler and logger.
12
+ If a kernel instance is provided, it also renders the exception details to the CLI for user visibility.
41
13
 
42
14
  Parameters
43
15
  ----------
44
- exception : BaseException
45
- The exception instance to be reported.
46
-
47
- Returns
48
- -------
49
- Throwable
50
- A destructured representation of the exception, containing its type, message, arguments, and traceback.
51
-
52
- Raises
53
- ------
54
- TypeError
55
- If the provided exception is not an instance of BaseException.
56
-
57
- Notes
58
- -----
59
- This method logs the exception details using the configured logger and returns a structured
60
- representation of the exception for further processing.
61
- """
62
- pass
63
-
64
- @abstractmethod
65
- def renderCLI(self, args: List[str], exception: BaseException) -> Any:
66
- """
67
- Renders a CLI-friendly error message for a given exception.
68
-
69
- Parameters
70
- ----------
71
- args : list
72
- The list of command-line arguments that were passed to the CLI.
73
- exception : BaseException
74
- The exception instance to be rendered.
16
+ kernel : Any
17
+ The kernel instance associated with the CLI, or None if not available.
18
+ request : Any
19
+ The request or arguments associated with the CLI command.
20
+ e : BaseException
21
+ The exception instance to be handled.
75
22
 
76
23
  Returns
77
24
  -------
78
25
  None
79
- This method does not return any value.
80
-
81
- Raises
82
- ------
83
- TypeError
84
- If the provided exception is not an instance of BaseException.
26
+ This method does not return any value. It performs side effects such as logging and output.
85
27
 
86
28
  Notes
87
29
  -----
88
- This method logs the error message using the configured logger and outputs
89
- the exception traceback to the console for user visibility.
90
- """
91
- pass
30
+ The exception is always reported using the exception handler and logger.
31
+ If a valid kernel is provided, the exception details are rendered to the CLI.
32
+ """
@@ -0,0 +1,77 @@
1
+ from abc import abstractmethod
2
+ from typing import Any, List
3
+ from orionis.console.output.contracts.console import IConsole
4
+ from orionis.services.log.contracts.log_service import ILogger
5
+
6
+ class IBaseExceptionHandler:
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
+
47
+ @abstractmethod
48
+ def report (self, exception: BaseException, log: ILogger) -> Any:
49
+ """
50
+ Report or log an exception.
51
+
52
+ Parameters
53
+ ----------
54
+ exception : BaseException
55
+ The exception instance that was caught.
56
+
57
+ Returns
58
+ -------
59
+ None
60
+ """
61
+ pass
62
+
63
+ @abstractmethod
64
+ def renderCLI(self, args: List[str], exception: BaseException, log: ILogger, console: IConsole) -> Any:
65
+ """
66
+ Render the exception message for CLI output.
67
+
68
+ Parameters
69
+ ----------
70
+ exception : BaseException
71
+ The exception instance that was caught.
72
+
73
+ Returns
74
+ -------
75
+ None
76
+ """
77
+ pass
@@ -2,9 +2,12 @@ import asyncio
2
2
  import time
3
3
  from pathlib import Path
4
4
  from typing import Any, List, Type
5
+ from orionis.console.base.contracts.scheduler import IBaseScheduler
5
6
  from orionis.console.base.scheduler import BaseScheduler
6
7
  from orionis.container.container import Container
7
8
  from orionis.container.contracts.service_provider import IServiceProvider
9
+ from orionis.failure.base.handler import BaseExceptionHandler
10
+ from orionis.failure.contracts.handler import IBaseExceptionHandler
8
11
  from orionis.foundation.config.app.entities.app import App
9
12
  from orionis.foundation.config.auth.entities.auth import Auth
10
13
  from orionis.foundation.config.cache.entities.cache import Cache
@@ -117,6 +120,9 @@ class Application(Container, IApplication):
117
120
  # Property to store the scheduler instance
118
121
  self.__scheduler: BaseScheduler = None
119
122
 
123
+ # Property to store the exception handler class
124
+ self.__exception_handler: Type[BaseExceptionHandler] = None
125
+
120
126
  # Flag to prevent re-initialization
121
127
  self.__initialized = True
122
128
 
@@ -383,9 +389,88 @@ class Application(Container, IApplication):
383
389
  # for complex and unique application requirements, supporting advanced customization
384
390
  # of every subsystem as needed.
385
391
 
392
+ def setExceptionHandler(
393
+ self,
394
+ handler: IBaseExceptionHandler
395
+ ) -> 'Application':
396
+ """
397
+ Register a custom exception handler class for the application.
398
+
399
+ This method allows you to specify a custom exception handler class that
400
+ inherits from BaseExceptionHandler. The handler class will be used to
401
+ manage exceptions raised within the application, including reporting and
402
+ rendering error messages. The provided handler must be a class (not an
403
+ instance) and must inherit from BaseExceptionHandler.
404
+
405
+ Parameters
406
+ ----------
407
+ handler : Type[BaseExceptionHandler]
408
+ The exception handler class to be used by the application. Must be a
409
+ subclass of BaseExceptionHandler.
410
+
411
+ Returns
412
+ -------
413
+ Application
414
+ The current Application instance, allowing for method chaining.
415
+
416
+ Raises
417
+ ------
418
+ OrionisTypeError
419
+ If the provided handler is not a class or is not a subclass of BaseExceptionHandler.
420
+
421
+ Notes
422
+ -----
423
+ The handler is stored internally and will be instantiated when needed.
424
+ This method does not instantiate the handler; it only registers the class.
425
+ """
426
+
427
+ # Ensure the provided handler is a subclass of BaseExceptionHandler
428
+ if not issubclass(handler, BaseExceptionHandler):
429
+ raise OrionisTypeError(f"Expected BaseExceptionHandler subclass, got {type(handler).__name__}")
430
+
431
+ # Store the handler class in the application for later use
432
+ self.__exception_handler = handler
433
+
434
+ # Return the application instance for method chaining
435
+ return self
436
+
437
+ def getExceptionHandler(
438
+ self
439
+ ) -> IBaseExceptionHandler:
440
+ """
441
+ Retrieve the currently registered exception handler instance.
442
+
443
+ This method returns an instance of the exception handler that has been set using
444
+ the `setExceptionHandler` method. If no custom handler has been set, it returns
445
+ a default `BaseExceptionHandler` instance. The returned object is responsible
446
+ for handling exceptions within the application, including reporting and rendering
447
+ error messages.
448
+
449
+ Returns
450
+ -------
451
+ BaseExceptionHandler
452
+ An instance of the currently registered exception handler. If no handler
453
+ has been set, returns a default `BaseExceptionHandler` instance.
454
+
455
+ Notes
456
+ -----
457
+ This method always returns an instance (not a class) of the exception handler.
458
+ If a custom handler was registered, it is instantiated and returned; otherwise,
459
+ a default handler is used.
460
+ """
461
+
462
+ # Check if an exception handler has been set
463
+ if self.__exception_handler is None:
464
+
465
+ # Return the default exception handler instance
466
+ return BaseExceptionHandler()
467
+
468
+ # Instantiate and return the registered exception handler
469
+ return self.__exception_handler()
470
+
386
471
  def setScheduler(
387
472
  self,
388
- scheduler: BaseScheduler
473
+ scheduler: IBaseScheduler
389
474
  ) -> 'Application':
390
475
  """
391
476
  Register a custom scheduler class for the application.
@@ -430,7 +515,7 @@ class Application(Container, IApplication):
430
515
 
431
516
  def getScheduler(
432
517
  self
433
- ) -> BaseScheduler:
518
+ ) -> IBaseScheduler:
434
519
  """
435
520
  Retrieve the currently registered scheduler instance.
436
521
 
@@ -450,8 +535,7 @@ class Application(Container, IApplication):
450
535
 
451
536
  # Check if a scheduler has been set
452
537
  if self.__scheduler is None:
453
- from orionis.console.default.scheduler import Scheduler as DefaultScheduler
454
- return DefaultScheduler()
538
+ return BaseScheduler()
455
539
 
456
540
  # Return the registered scheduler instance
457
541
  return self.__scheduler()
@@ -2,6 +2,7 @@ from abc import abstractmethod
2
2
  from pathlib import Path
3
3
  from typing import Any, List, Type
4
4
  from orionis.console.base.scheduler import BaseScheduler
5
+ from orionis.failure.contracts.handler import IBaseExceptionHandler
5
6
  from orionis.foundation.config.roots.paths import Paths
6
7
  from orionis.container.contracts.service_provider import IServiceProvider
7
8
  from orionis.container.contracts.container import IContainer
@@ -93,6 +94,68 @@ class IApplication(IContainer):
93
94
  """
94
95
  pass
95
96
 
97
+ def setExceptionHandler(
98
+ self,
99
+ handler: IBaseExceptionHandler
100
+ ) -> 'IApplication':
101
+ """
102
+ Register a custom exception handler class for the application.
103
+
104
+ This method allows you to specify a custom exception handler class that
105
+ inherits from BaseHandlerException. The handler class will be used to
106
+ manage exceptions raised within the application, including reporting and
107
+ rendering error messages. The provided handler must be a class (not an
108
+ instance) and must inherit from BaseHandlerException.
109
+
110
+ Parameters
111
+ ----------
112
+ handler : Type[BaseHandlerException]
113
+ The exception handler class to be used by the application. Must be a
114
+ subclass of BaseHandlerException.
115
+
116
+ Returns
117
+ -------
118
+ Application
119
+ The current Application instance, allowing for method chaining.
120
+
121
+ Raises
122
+ ------
123
+ OrionisTypeError
124
+ If the provided handler is not a class or is not a subclass of BaseHandlerException.
125
+
126
+ Notes
127
+ -----
128
+ The handler is stored internally and will be instantiated when needed.
129
+ This method does not instantiate the handler; it only registers the class.
130
+ """
131
+ pass
132
+
133
+ def getExceptionHandler(
134
+ self
135
+ ) -> IBaseExceptionHandler:
136
+ """
137
+ Retrieve the currently registered exception handler instance.
138
+
139
+ This method returns an instance of the exception handler that has been set using
140
+ the `setExceptionHandler` method. If no custom handler has been set, it returns
141
+ a default `BaseHandlerException` instance. The returned object is responsible
142
+ for handling exceptions within the application, including reporting and rendering
143
+ error messages.
144
+
145
+ Returns
146
+ -------
147
+ BaseHandlerException
148
+ An instance of the currently registered exception handler. If no handler
149
+ has been set, returns a default `BaseHandlerException` instance.
150
+
151
+ Notes
152
+ -----
153
+ This method always returns an instance (not a class) of the exception handler.
154
+ If a custom handler was registered, it is instantiated and returned; otherwise,
155
+ a default handler is used.
156
+ """
157
+ pass
158
+
96
159
  @abstractmethod
97
160
  def setScheduler(
98
161
  self,
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.492.0"
8
+ VERSION = "0.494.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.492.0
3
+ Version: 0.494.0
4
4
  Summary: Orionis Framework – Elegant, Fast, and Powerful.
5
5
  Home-page: https://github.com/orionis-framework/framework
6
6
  Author: Raul Mauricio Uñate Castro
@@ -1,14 +1,14 @@
1
1
  orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  orionis/app.py,sha256=b69fOzj2J8Aw5g0IldWZXixUDeeTO9vcHc_Njses9HU,603
3
3
  orionis/console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- orionis/console/kernel.py,sha256=xye5-uiz1Se_XOxleOv9gE-iQ0aqfEMoVKaoBiiStx0,4180
4
+ orionis/console/kernel.py,sha256=czEZQV-BcL9AV_mNppxCJEz56Hin5ejq1BtXZBSA3Ho,4150
5
5
  orionis/console/args/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  orionis/console/args/argument.py,sha256=Is8Z8_kW4DvcK1nK1UU-sa6Pk0BeOdcRczCayW0ZVHc,20360
7
7
  orionis/console/args/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  orionis/console/args/enums/actions.py,sha256=S3T-vWS6DJSGtANrq3od3-90iYAjPvJwaOZ2V02y34c,1222
9
9
  orionis/console/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  orionis/console/base/command.py,sha256=nasVPyKEvuv8sDFEWXhHyBCWAmSLfPPm2XlKaYYt_pM,6642
11
- orionis/console/base/scheduler.py,sha256=dy8qQrUbKB6Uko1gtr3JzZaSd1iaOm-A8hUhbmFHvD4,3724
11
+ orionis/console/base/scheduler.py,sha256=lUHd83YhpsojxcCDme2e9Gcw6ebnsdRFgny4MKH5-rc,3380
12
12
  orionis/console/base/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  orionis/console/base/contracts/command.py,sha256=vmAJD0yMQ5-AD_s9_xCFEAl64sKk65z7U2E196dALQM,5760
14
14
  orionis/console/base/contracts/scheduler.py,sha256=y8q4qv6oxjnWSt9G0HP2IjogtWIASfJaMO5vkG22U1Q,1184
@@ -29,8 +29,6 @@ orionis/console/contracts/reactor.py,sha256=Xeq7Zrw6WE5MV_XOQfiQEchAFbb6-0TjLpjW
29
29
  orionis/console/contracts/schedule.py,sha256=eGjcOH7kgdf0fWDZRfOFUQsIx4E8G38ayX5JwpkpN8E,4977
30
30
  orionis/console/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  orionis/console/core/reactor.py,sha256=Lwk6u0lO1n-E74Kyiw0xYwFMbQoJn7uszGoN9RNHS-c,30597
32
- orionis/console/default/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- orionis/console/default/scheduler.py,sha256=5ZEKqc4BnHg4CAiJ_XJcy9WcJvmunmP3BHcUhf77asg,893
34
32
  orionis/console/dumper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
33
  orionis/console/dumper/dump.py,sha256=CATERiQ6XuIrKQsDaWcVxzTtlAJI9qLJX44fQxEX8ws,22443
36
34
  orionis/console/dumper/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -95,13 +93,16 @@ orionis/container/validators/is_subclass.py,sha256=4sBaGLoRs8nUhuWjlP0VJqyTwVHYq
95
93
  orionis/container/validators/is_valid_alias.py,sha256=4uAYcq8xov7jZbXnpKpjNkxcZtlTNnL5RRctVPMwJes,1424
96
94
  orionis/container/validators/lifetime.py,sha256=IQ43fDNrxYHMlZH2zlYDJnlkLO_eS4U7Fs3UJgQBidI,1844
97
95
  orionis/failure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
98
- orionis/failure/catch.py,sha256=6Ijp7GDTJ3UfTFa42E_yMt7PAYnXSG8zHRkE-IBRxHU,6133
96
+ orionis/failure/catch.py,sha256=1-G1U4Udzkd6QSmQ9oKQeUaFjosA9hNfzwmOWVIbUZU,3760
97
+ orionis/failure/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
98
+ orionis/failure/base/handler.py,sha256=1LDcJO4-tgam225jWT0lbh4VzqRSu5iOtcH5JSkMugk,4845
99
99
  orionis/failure/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
100
- orionis/failure/contracts/catch.py,sha256=sdtjhq6ToXrtdKR0Bw9YYUqofvm-FGULPnz4dZVddWQ,2844
100
+ orionis/failure/contracts/catch.py,sha256=e2wM1p6VxbvAjgWm-MwoM9p2ystSsyBu8Qnt6Ehr6Vc,1179
101
+ orionis/failure/contracts/handler.py,sha256=1WyFx7D9h5chNnOXDQhg6o-RqNfhTHblm_xWzCDu4SM,2161
101
102
  orionis/failure/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
102
103
  orionis/failure/entities/throwable.py,sha256=ogys062uhim5QMYU62ezlnumRAnYQlUf_vZvQY47S3U,1227
103
104
  orionis/foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
104
- orionis/foundation/application.py,sha256=-v9VCFdYyLhpeaeEgHkSeZH4QjTVVFM5l4B1tQGGgsA,78625
105
+ orionis/foundation/application.py,sha256=wiaVt7Y7iDmeZkqs6jK1lgD9C46aqDohmzIMxoFjKZo,81976
105
106
  orionis/foundation/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
106
107
  orionis/foundation/config/startup.py,sha256=vbzduprRCNyYeR2nnMaqc1uKXw6PTzAY2jVfXNQKN8I,9691
107
108
  orionis/foundation/config/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -195,7 +196,7 @@ orionis/foundation/config/testing/enums/drivers.py,sha256=mwv47FcKDXEOxydQXAGtkd
195
196
  orionis/foundation/config/testing/enums/mode.py,sha256=IbFpauu7J-iSAfmC8jDbmTEYl8eZr-AexL-lyOh8_74,337
196
197
  orionis/foundation/config/testing/enums/verbosity.py,sha256=Z-FQ6C3rxbRwP8HoVibbgRMGcsen2SwTuEy3wnjdIhc,486
197
198
  orionis/foundation/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
198
- orionis/foundation/contracts/application.py,sha256=Pr1-fl3SMuaq9WYQko9N8DhYtRXcuZG3tMNgBMUdsEs,28972
199
+ orionis/foundation/contracts/application.py,sha256=vLf7ozmdBY3F6pPQipecwo_JbvHshq3jTD4D8YqPy7c,31407
199
200
  orionis/foundation/contracts/config.py,sha256=mCyA43f0n_e-CEL0f-sWWgE-M7GicS_aEtC_TNbn_yc,802
200
201
  orionis/foundation/exceptions/__init__.py,sha256=q6we1N8kcd6j6GjUJY30WQhhHnqF9RXA0c6-ksEztlc,294
201
202
  orionis/foundation/exceptions/integrity.py,sha256=mc4pL1UMoYRHEmphnpW2oGk5URhu7DJRREyzHaV-cs8,472
@@ -216,7 +217,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=72SoixFog9IOE9Ve9Xcfw6
216
217
  orionis/foundation/providers/testing_provider.py,sha256=SrJRpdvcblx9WvX7x9Y3zc7OQfiTf7la0HAJrm2ESlE,3725
217
218
  orionis/foundation/providers/workers_provider.py,sha256=oa_2NIDH6UxZrtuGkkoo_zEoNIMGgJ46vg5CCgAm7wI,3926
218
219
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
219
- orionis/metadata/framework.py,sha256=tZjkExU-g76gkmbtzvK3VCB5TJEKdHJLvFcM4SL8D1s,4109
220
+ orionis/metadata/framework.py,sha256=JVYrHvNcvIwP-Tu8ZDFmAKPmem6M2lZLP-0c-5oXNp4,4109
220
221
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
221
222
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
222
223
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -390,7 +391,7 @@ orionis/test/validators/web_report.py,sha256=n9BfzOZz6aEiNTypXcwuWbFRG0OdHNSmCNu
390
391
  orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnIfJYgc,1206
391
392
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
392
393
  orionis/test/view/render.py,sha256=f-zNhtKSg9R5Njqujbg2l2amAs2-mRVESneLIkWOZjU,4082
393
- orionis-0.492.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
394
+ orionis-0.494.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
394
395
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
395
396
  tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
396
397
  tests/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -537,8 +538,8 @@ tests/testing/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
537
538
  tests/testing/validators/test_testing_validators.py,sha256=WPo5GxTP6xE-Dw3X1vZoqOMpb6HhokjNSbgDsDRDvy4,16588
538
539
  tests/testing/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
539
540
  tests/testing/view/test_render.py,sha256=tnnMBwS0iKUIbogLvu-7Rii50G6Koddp3XT4wgdFEYM,1050
540
- orionis-0.492.0.dist-info/METADATA,sha256=sXzVQKNb3NcgGIQ7CYANg1UV56ki4dzvonYgAjszsdw,4801
541
- orionis-0.492.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
542
- orionis-0.492.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
543
- orionis-0.492.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
544
- orionis-0.492.0.dist-info/RECORD,,
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,,
@@ -1,27 +0,0 @@
1
- from orionis.console.base.scheduler import BaseScheduler
2
- from orionis.console.contracts.schedule import ISchedule
3
-
4
- class Scheduler(BaseScheduler):
5
-
6
- def tasks(self, schedule: ISchedule):
7
- """
8
- Defines and registers scheduled tasks for the application.
9
-
10
- Parameters
11
- ----------
12
- schedule : ISchedule
13
- The schedule object used to define and register scheduled commands.
14
-
15
- Returns
16
- -------
17
- None
18
- This method does not return any value. It is intended to be overridden
19
- by subclasses to specify scheduled tasks.
20
-
21
- Notes
22
- -----
23
- Subclasses should implement this method to add specific tasks to the scheduler
24
- using the provided `schedule` object. This method enforces that each subclass
25
- defines its own scheduled tasks.
26
- """
27
- pass
File without changes