-
Notifications
You must be signed in to change notification settings - Fork 5
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
Exception derived class created #10
base: master
Are you sure you want to change the base?
Conversation
help me to create the custom error :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for taking care of the issue. I have added a few comments. Hope this helps. Feel free to contact if you have any doubt.
@@ -0,0 +1,60 @@ | |||
# Default ignored files | |||
/shelf/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What code editor do you use? I think we can create minimal .gitignore.
@@ -2,6 +2,7 @@ | |||
from token_type import TokenType | |||
|
|||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid adding extra space and removing space, you can use autopep8
or similar extension in the code editor.
|
||
# raise Error | ||
#FIX THIS ERROR | ||
class Error(Exception): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can move the Error
class outside the Scanner
class. It would be better to rename the error, the error name which relates to scanner would be good. Do we need def __init__(...)
? I think inheriting the Exception takes care of that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your suggestions @twentyse7en :D.
i'm trying to create custom error.