[Error-Handling]: instructions are unclear, and wrong programs pass the tests
See original GitHub issueI just did the error-handling exercise, and had several issues:
- It was unclear at first what to do with inputs. Looking at the tests, it seemed that trying to convert the input to
int
was the right thing to try, but this is not mentioned in the readme or the stubs. - The test for whether a method throws an exception will pass any error that might occur, not just if it’s intentionally raised:
def handle_error_by_throwing_exception():
raise "(╯°□°)╯︵ ┻━┻" # Raising a string is a TypeError, but passes the test
- When returning a tuple, which element should be the result and which one the status? What should the result element be when it fails? No suggestion
- No mention of advantages or disadvantages of the different kinds of error handling, or what is idiomatic Python.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Clean Code and the Art of Exception Handling - Toptal
Exception Handling : It's a Good Thing · Always create your own ApplicationError hierarchy · Never rescue Exception · Never rescue more exceptions...
Read more >Error Messages: Examples, Best Practices & Common Mistakes
4 common mistakes with error messages · 1. Ambiguity · 2. Condescending language/blaming the user · 3. Poor placement of error messages ·...
Read more >Errors and exceptions - Object-Oriented Programming in Python
Errors or mistakes in a program are often referred to as bugs. They are almost always the fault of the programmer. The process...
Read more >Exceptions and Error Handling, C++ FAQ - Standard C++
The basic answer is: Using exceptions for error handling makes your code simpler, cleaner, and less likely to miss errors. But what's wrong...
Read more >What is Exception Handling? - SearchSoftwareQuality
Exception handling is the process of responding to unwanted or unexpected events when a computer program runs. Exception handling deals with these events...
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
The entire
error-handling
exercise is a bit problematic in its current implementation. It will likely be replaced with a proper Concept Exercise in v3.@cmccandless – I think this would be good to leave open as a reminder. Otherwise, it might get lost in the shuffle.
Ultimately, we want to log both the error-handling concept exercise issues and a re-write of this practice exercise as its own issue, but I don’t have time atm to do so – so I think the best bet is to leave this pending.