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

Rename CryptoKit errors #274

Open
0xTim opened this issue Oct 12, 2024 · 3 comments · May be fixed by #285
Open

Rename CryptoKit errors #274

0xTim opened this issue Oct 12, 2024 · 3 comments · May be fixed by #285

Comments

@0xTim
Copy link
Contributor

0xTim commented Oct 12, 2024

New API Proposal: CryptoError

Motivation:

CryptoKit errors are publicly exposed in the API which is confusing since from the outside CryptoKit is an implementation detail so it would be nice to rename this to reflect the name of the package. A typealias would help for those that want the backwards compatibility

Importance:

Not major but definitely a paper cut

@Lukasa
Copy link
Contributor

Lukasa commented Oct 12, 2024

The issue with renaming CryptoKitError is that on Apple platforms these errors actually come from CryptoKit. Changing the error there is pretty hard: it would represent an ABI break to rename completely, even with the typealias, so that’s not tenable, meaning there’d be two similar errors only one of which is thrown.

While I agree this is a paper cut, I don’t think this issue is severe enough to warrant a change. But I’d be happy to hear disagreement.

@0xTim
Copy link
Contributor Author

0xTim commented Oct 12, 2024

Adding a typealias for CryptoKitError to CryptoError wouldn't break anything right? All the original stuff would continue to work but people using Swift Crypto would be able to catch and deal with CryptoErrors instead of knowing about CryptoKit

@Lukasa
Copy link
Contributor

Lukasa commented Oct 13, 2024

Yes, the typealias in the reverse direction will work.

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 a pull request may close this issue.

2 participants