Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RequestException is the base class exception? #134

Open
nickmoreton opened this issue Jan 3, 2022 · 1 comment · May be fixed by #136
Open

RequestException is the base class exception? #134

nickmoreton opened this issue Jan 3, 2022 · 1 comment · May be fixed by #136
Assignees

Comments

@nickmoreton
Copy link
Collaborator

Suggestion:

I believe RequestException is the base class exception so if you want to keep it specific then it might be better to put this one last https://stackoverflow.com/a/47007419

I've added some snippets below which could work to shorten the code a little but I haven't got a lot of experience with exepction handling so not sure if they would be considered bad practise or not:

    except (requests.ConnectionError, requests.HTTPError, requests.ReadTimeout, requests.Timeout, requests.ConnectTimeout, requests.RequestException) as e :
        print(f"{type(e).__name__}: {src}")
        return None, False, None

or

    except Exception as e:
        print(f"{type(e).__name__}: {src}")
        return None, False, None

Originally posted by @Morsey187 in #125 (comment)

@nickmoreton nickmoreton added the enhancement New feature or request label Jan 3, 2022
@nickmoreton nickmoreton linked a pull request Jan 3, 2022 that will close this issue
3 tasks
@nickmoreton nickmoreton linked a pull request Jan 3, 2022 that will close this issue
3 tasks
@nickmoreton nickmoreton pinned this issue Jan 4, 2022
@nickmoreton
Copy link
Collaborator Author

@Morsey187 Hi Ben. When you have a chance would you be able to review the PR I created for this issue you raised. Thanks Nick

@nickmoreton nickmoreton added Should we or not? and removed enhancement New feature or request labels Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant