We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
StarSearch/starsearch/phase3Archive.py
Lines 548 to 575 in e47d0d9
Comment on this part of the code: This try except is a "bit" to large, the exception catch everything, the message might be misleading.
You need to include the try only where the specific problem might occur, or alternative, you have to catch the correct exception...
The text was updated successfully, but these errors were encountered:
The files does not close if the code enters the exception. Furthermore, instead of manually opening and closing files, I would suggest the use of a context manager (it makes sure that your file is closed, even if an exception occurs - read this more more info: https://towardsdatascience.com/https-medium-com-sinister-why-using-a-context-manager-is-a-better-choice-55ccfcecddb8)
The syntax is something like this :
with open( ... ) as file:
Another detail, you can print the exact error message:
try: < code> except Exception as e: print(e)
this way your "e" will be exact exception that is thrown in the "try" block. You can switch it with other Exception types, i.e. SyntaxError, ...
Sorry, something went wrong.
There is another issue. When you enter the exception, you will overwrite the "f" file. Npot sure if .write appends or writes over everything
No branches or pull requests
StarSearch/starsearch/phase3Archive.py
Lines 548 to 575 in e47d0d9
Comment on this part of the code:
This try except is a "bit" to large, the exception catch everything, the message might be misleading.
You need to include the try only where the specific problem might occur, or alternative, you have to catch the correct exception...
The text was updated successfully, but these errors were encountered: