Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-143200

Refactor common libraries to avoid direct StopActorExecutionError calls

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • None
    • rhel-upgrades
    • 20
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None
    • 20

      Public and shared libraries should not control actor execution flow by raising StopActorExecutionError. Instead, they should raise specific exceptions and let the consuming actors decide how to handle failures. This improves separation of concerns, testability, and allows actors to handle the same error differently based on their specific context. 

      Solution:
      1. Define custom exception classes (e.g., InvalidRepoDefinitionError) in the libraries or a shared exceptions module
      2. Have library functions raise these custom exceptions instead of StopActorExecutionError
      3. Update consuming actors to catch these exceptions and raise StopActorExecutionError with appropriate context
      4. Update unit tests
      5. Update the best practices for actor development (https://leapp.readthedocs.io/en/stable/best-practices.html#use-convenience-exceptions-to-stop-the-actor-s-execution) to not suggest to use this exception in shared libs.

              leapp-notifications leapp-notifications
              kkula@redhat.com Karolina Kula
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: