Skip to content
New issue

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

Document AnalysisError #127

Merged
merged 6 commits into from
Jan 21, 2025
Merged

Document AnalysisError #127

merged 6 commits into from
Jan 21, 2025

Conversation

dsavchenko
Copy link
Member

No description provided.

@dsavchenko dsavchenko linked an issue Jan 9, 2025 that may be closed by this pull request
Copy link
Contributor

@burnout87 burnout87 left a comment

Choose a reason for hiding this comment

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

What do you think?

content/docs/guide-development.md Outdated Show resolved Hide resolved
content/docs/guide-development.md Outdated Show resolved Hide resolved
content/docs/guide-development.md Outdated Show resolved Hide resolved
@dsavchenko dsavchenko requested a review from burnout87 January 10, 2025 15:57
@volodymyrss
Copy link
Member

I would kindly ask few more people who are the likely users of this feature to review the change. I add them in reviewers. Could you please help?

Copy link
Contributor

@ferrigno ferrigno left a comment

Choose a reason for hiding this comment

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

the sentence "is show below is shown below" is a leftover at line 233.

I do not understand why one should define a class, is you raise an exception is it not caught?
The lack of indentation does not allow me to understand if the "try: except is within the class or not. Maybe linking a usage example would be useful.

@dsavchenko
Copy link
Member Author

I do not understand why one should define a class, is you raise an exception is it not caught?
The lack of indentation does not allow me to understand if the "try: except is within the class or not. Maybe linking a usage example would be useful.

The indentation is not lacking here. This is a screenshot from the actual usage example: a Fermi notebook. Maybe using Ellipsis ... confuses you here. I will update the screenshot with equivalent syntax using pass.

The idea of the dedicated class is to distinguish a properly handled exception in the notebook from the unexpected ones.
We do it actually for our own convenience, because we don't want this type of exceptions to appear in Sentry.

@ferrigno
Copy link
Contributor

The indentation is not lacking here. This is a screenshot from the actual usage example: a Fermi notebook. Maybe using Ellipsis ... confuses you here. I will update the screenshot with equivalent syntax using pass.

Indeed, it was confusing, maybe you can link the example notebook if not done already.

The idea of the dedicated class is to distinguish a properly handled exception in the notebook from the unexpected ones. We do it actually for our own convenience, because we don't want this type of exceptions to appear in Sentry.
OK, now I see what you mean.

@dsavchenko
Copy link
Member Author

Indeed, it was confusing, maybe you can link the example notebook if not done already.

Most example screenshots in this guide are made with the Fermi notebook, and it's referenced in the beginning

@dsavchenko dsavchenko requested a review from ferrigno January 10, 2025 20:29
Copy link

@anawas anawas left a comment

Choose a reason for hiding this comment

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

This looks good to me.
It's good practice to introduce designated Exception classes. This allows you to communicate errors more clearly than simply throwing a general excpetion (ie e.g. RuntimeError).

@volodymyrss
Copy link
Member

This looks good to me. It's good practice to introduce designated Exception classes. This allows you to communicate errors more clearly than simply throwing a general excpetion (ie e.g. RuntimeError).

Thanks for reviewing! Does the text of the doc look comprehensive too, from a user point of view?

@anawas
Copy link

anawas commented Jan 16, 2025

Thanks for reviewing! Does the text of the doc look comprehensive too, from a user point of view?

Yes, the text is clear. It explains how you should handle errors. It is a good reminder to those who heard about this already. However, some users may not be familiar with the concept of classes in Python. Because you can write good code without this concept. But I would not care. You do not need to do it. The code will run fine even if you do not use classes.

@dsavchenko
Copy link
Member Author

Should we merge?

@volodymyrss
Copy link
Member

Ok, I think that'd be enough reviews.

@volodymyrss volodymyrss merged commit 281d1ae into master Jan 21, 2025
2 checks passed
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.

Suggest special exception class for "expected" exceptions
6 participants