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

Simplify error code naming system #33

Merged
merged 1 commit into from
Oct 2, 2022
Merged

Simplify error code naming system #33

merged 1 commit into from
Oct 2, 2022

Conversation

dosisod
Copy link
Owner

@dosisod dosisod commented Oct 2, 2022

Currently, the error code class for a given check has to have an arbitrary name which must start with "Error", but cannot be "ErrorCode" or "Error". Given that the name of the error class is not used/displayed anywhere, and doesn't provide any extra context, having to give them a name (similar to the filename) doesn't make a lot of sense. I've updated all checks to be called "ErrorInfo", making all the checks more consistent (similar to the name of the "check" functions). At some point I might make it required for these error info classes to be named "ErrorInfo", but that would be a breaking change.

If we do want to "name" the checks, an explicit "name" field in the class would be a better option, and better then relying on the classname.

As an aside, there should probably be warnings that go off if you have a check function or error class which is not the right type, or for whatever reason, your check cannot be loaded.

Currently, the error code class for a given check has to have an arbitrary
name which must start with "Error", but cannot be "ErrorCode" or "Error". Given
that the name of the error class is not used/displayed anywhere, and doesn't
provide any extra context, having to give them a name (similar to the filename)
doesn't make a lot of sense. I've updated all checks to be called "ErrorInfo",
making all the checks more consistent (similar to the name of the "check"
functions). At some point I might make it required for these error info classes
to be named "ErrorInfo", but that would be a breaking change.

If we do want to "name" the checks, an explicit "name" field in the class would
be a better option, and better then relying on the classname.

As an aside, there should probably be warnings that go off if you have a check
function or error class which is not the right type, or for whatever reason, your
check cannot be loaded.
@dosisod dosisod self-assigned this Oct 2, 2022
@dosisod dosisod merged commit 55de2e0 into master Oct 2, 2022
@dosisod dosisod deleted the simplify-errors branch October 2, 2022 05:01
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant