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

Error reporting #235

Open
leandrodamascena opened this issue Jul 15, 2020 · 3 comments
Open

Error reporting #235

leandrodamascena opened this issue Jul 15, 2020 · 3 comments
Assignees
Labels
kind/feature New feature or request proposal Suggestion proposed status/accepted Accepted proposal

Comments

@leandrodamascena
Copy link
Contributor

@mingrammer @gabriel-tessier

Related to #229.

Sometimes graphivz exe isn't installed, user don't read documentation in a appropriate way or even the diagrams tool might have a bug, and because of that the diagrams tool should have a more consistent error handler..

Of course we need to discuss about messages and exceptions, but I think it's a good improvement. :).

Look this prototype.

Using a decorator on exit ("with" implementation all execute init and exit). In this case I removed graphviz exe from my path and got a ExecutableNotFound exception
image
image
image

Using a decorator to on init . In this case I simulated a mistake and changed "name" to "nme" and got a TypeError exception
image
image
image
image

@leandrodamascena leandrodamascena changed the title Error reporing Error reporting Jul 15, 2020
@gabriel-tessier
Copy link
Collaborator

@leandrodamascena
Look good it will help to figure out problems more easily!

@mingrammer
Copy link
Owner

mingrammer commented Jul 16, 2020

This feature looks amazing. Thank you for work on it!

I have two suggestions for this.

  1. Decorator name: In my thought, @exception decorator could make users confused that seems to throw an exception rather than catching the exceptions. So it would be good to change to a more meaningful name (less confusable) such as catch, report, or whatever.

  2. Message format: What do you think about adding a name (key) for errors too in the message like Python and Platform?

Error:         TypeError
Python:        3.8.2...
Platform:      Windows...

@mingrammer mingrammer added kind/feature New feature or request proposal Suggestion proposed status/accepted Accepted proposal labels Jul 16, 2020
@leandrodamascena
Copy link
Contributor Author

@mingrammer @gabriel-tessier

Great that you both liked this. I need few days to prepare the code and make a PR, first I need to finish this gabriel-tessier/diagrams-web#1 and other things in other projects.

Before to push PR I paste here the prototype update.

Thank you guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request proposal Suggestion proposed status/accepted Accepted proposal
Projects
None yet
Development

No branches or pull requests

3 participants