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

Make target-specific errors private #562

Merged
merged 1 commit into from
Dec 11, 2024
Merged

Make target-specific errors private #562

merged 1 commit into from
Dec 11, 2024

Conversation

newpavlov
Copy link
Member

@newpavlov newpavlov commented Dec 9, 2024

The main reason for existence of the target-specific errors is nicer error descriptions. Users arguably should not match on those error constants since our inner implementation may change together with possible error codes (for example, like with IOS_SEC_RANDOM). Marking the error constants as private we get flexibility to change error codes and names.

Additionally, the internal_desc change reduces generated binary size since compiler no longer has to include irrelevant error descriptions. Ideally the target-specific error descriptions would be defined in the relevant modules, but I couldn't find a good way to do it, so, unfortunately, I had to partially duplicate backend cfgs in internal_desc.

@newpavlov newpavlov requested a review from josephlr December 9, 2024 16:45
@newpavlov newpavlov marked this pull request as ready for review December 9, 2024 16:45
Copy link
Member

@josephlr josephlr 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 and removes confusing stuff from the public API. I was also trying to figure out ways to put the descriptions in the platform-specific files, but I also don't know how to do this.

I'll keep thinking about it, but you should merge this in the meantime.

@newpavlov newpavlov merged commit 83bef12 into master Dec 11, 2024
60 checks passed
@newpavlov newpavlov deleted the private_errors branch December 11, 2024 07:59
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.

2 participants