Skip to content

Refactor all exception handling in code #99

@KeerthanaAP

Description

@KeerthanaAP

There are several functions in the code that return error messages as plain strings .for example, "Request timed out" or "Error while sending request to url", instead of raising proper exceptions. Since these string-based errors are not consistently checked in the calling code, they can lead to unexpected issues like ValueError, silent failures, or crashes.

For example:
https://github.com/ocp-power-automation/ci-monitoring-automation/blob/main/monitor.py#L1260

if check_if_sensitive_info_exposed function return error, its not handled in the calling function.

possible solution:

  1. Raise Exceptions instead of returning strings
  2. Add validation in calling code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions