Builtin vs custom exceptions
See original GitHub issueDescription of issue or feature request: Before releasing TUF 1.0.0 we should review our code and make sure that:
- We are using built-in exceptions (
ValueError
,TypeError
,KeyError
, etc.) consistently and idiomatically. - We are using custom exceptions when it makes sense and not in places that could be replaced by a built-in exception.
_Initiated from comment https://github.com/theupdateframework/python-tuf/pull/1725#pullrequestreview-856729491_
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Should we use custom exceptions in Python? | by Marcin Kozak
Built-in exceptions offer information about Python-related problems, and custom exceptions will add information about project-related problems.
Read more >Throwing custom exceptions in Java versus built in exceptions
As a general rule of thumb, when deciding whether or not to create a custom exception class, I try and use the built-in...
Read more >Understanding, Defining, and Using Custom Exceptions
Custom exceptions are exception types you define yourself in your project. They basically inherit from the Exception base class and implement ...
Read more >Exception Class and Built-In Exceptions | Apex Reference Guide
An exception denotes an error that disrupts the normal flow of code execution. You can use Apex built-in exceptions or create custom exceptions....
Read more >Custom exceptions in Python - how and what for?
Exceptions are a standard way of signalling errors in Python. You can improve readability of your code of using custom exceptions classes.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There are issues for all of those:
We can close this issue as it’s a little vague.
We went through this with Martin and came back with this list:
We will file issues for these so there is something actionable. After these issues are filed I believe this meta-issue can be closed