Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactor: make gem errors inherit from base classes #37

Merged
merged 4 commits into from
Oct 23, 2023

Conversation

matteoredz
Copy link
Owner

The new error hierarchy would look like this:

ItaxCode::Error
└── ItaxCode::Encoder::Error
    └── ItaxCode::Encoder::SomeError
└── ItaxCode::Parser::Error
    └── ItaxCode::Parser::SomeError
└── ...

@matteoredz matteoredz added the enhancement New feature or request label Oct 19, 2023
@matteoredz matteoredz self-assigned this Oct 19, 2023
@matteoredz matteoredz linked an issue Oct 19, 2023 that may be closed by this pull request
@matteoredz matteoredz marked this pull request as ready for review October 19, 2023 14:22
@blocknotes
Copy link

Thank you for the fast PR 💪
It seems good!

Just a minor thing: https://github.com/matteoredz/itax-code/pull/37/files#diff-91365432354c46335ab8560b08d3f5f1821e48a7e0fa021a543fef528fe01d68R7
Error = Class.new(Error) <= this point may seem unclear - perhaps Error = Class.new(ItaxCode::Error) ?

BTW, it does the job 😁

@matteoredz
Copy link
Owner Author

Thank you for the fast PR 💪 It seems good!

Just a minor thing: https://github.com/matteoredz/itax-code/pull/37/files#diff-91365432354c46335ab8560b08d3f5f1821e48a7e0fa021a543fef528fe01d68R7 Error = Class.new(Error) <= this point may seem unclear - perhaps Error = Class.new(ItaxCode::Error) ?

BTW, it does the job 😁

Np 😃 It's indeed using the module scope to access the outer ItaxCode::Error class. I'd avoid the prefix as it's unnecessary in this case.

@matteoredz matteoredz merged commit 99b00f1 into main Oct 23, 2023
@matteoredz matteoredz deleted the 36-base-error-class-for-errors branch October 23, 2023 13:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Base error class for errors?
2 participants