Skip to content

Conversation

@rhijjawi
Copy link

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.

@rhijjawi rhijjawi mentioned this pull request Jul 19, 2021
2 tasks
@shyamcody
Copy link

shyamcody commented Jul 19, 2021

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.

@rhijjawi
Copy link
Author

Done 👍

@rhijjawi
Copy link
Author

#34

@shyambhu-mukherjee
Copy link

I don't think raise <string> is a valid way to raise an error. Please provide some type to the error, i.e. raise valueError(string) or so on. Please correct me if I am wrong; but try to run your code sample in local and check if it runs.

@rhijjawi
Copy link
Author

rhijjawi commented Aug 1, 2021

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.

@rudiejd
Copy link

rudiejd commented Aug 2, 2021

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what type of exceptions would get raised here? is it possible to raise other named exceptions in this block?

Copy link
Author

@rhijjawi rhijjawi Sep 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rhijjawi rhijjawi mentioned this pull request Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants