Raise error that can be handled by try/except#45
Raise error that can be handled by try/except#45rhijjawi wants to merge 3 commits intogeekpradd:masterfrom
Conversation
|
There are also errors being printed in line 63,94,111 of core.py. @rhijjawi can you please add changes so that we raise error in them as well. |
|
Done 👍 |
|
I don't think |
|
The git owner @geekpradd set that part up. I could push a fix that would work around that. Keep in mind that that solution raise works well in case you don't know what error is going to be thrown. |
|
Was about to submit a PR with the exact same code verbatim. Would be awesome if this gets added because right now I'm hashing the error message to check whether a word is invalid |
| except Exception as e: | ||
| if disable_errors == False: | ||
| print("Error: The Following Error occured: %s" % e) | ||
| raise e |
There was a problem hiding this comment.
what type of exceptions would get raised here? is it possible to raise other named exceptions in this block?
There was a problem hiding this comment.
Sorry I just saw this, I haven't been on GitHub in a while. Depends on the error in the Exception. If anyone knows the complete list of errors thrown by this exception, go ahead and list them here.
Issue #34 refers to the fact that when a word is not found, the console prints an error that cannot be captured. This PR fixes this issue by raising an error that can be handled.