8000 Issue : Use a more specific exception when handling file opening errors · Issue #251 · donnemartin/haxor-news · GitHub
[go: up one dir, main page]

Skip to content

Issue : Use a more specific exception when handling file opening errors #251

@PrinceSajjadHussain

Description

@PrinceSajjadHussain

Body:
In config.py, the load_config function catches IOError when trying to open the configuration file. While this works, it's better practice to catch the more specific FileNotFoundError which is raised when a file does not exist. This makes the code clearer and more robust as it explicitly handles the intended error condition (file not found) and avoids accidentally catching other types of IO errors that might occur.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0