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

[SR-9696] SPM's Utility ArgumentParserError and ArgumentConversionError not conforming to LocalizedError #4880

Closed
swift-ci opened this issue Jan 17, 2019 · 1 comment
Labels

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-9696
Radar None
Original Reporter bontoJR (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 380fea13a0d2facc9a1c038b59c4851e

Issue Description:

Swift Package Manager utilities classes ArgumentParserError and ArgumentConversionError are not conforming to LocalizedError protocol which means the property localizedError returns a technical error message like:

Utility.ArgumentParserError error 1.

This can be quickly fixed in project with something similar to:

extension ArgumentParserError: LocalizedError {
    public var errorDescription: String? {
        return description
    }
}

This change would lead to a more user friendly error message, like:

unknown option XYZ; use --help to list available options

I think LocalizedError protocol should be used for both ArgumentParserError and ArgumentConversionError inside SPM's code directly.

@swift-ci
Copy link
Contributor Author

Comment by Kohki Miki (JIRA)

Did it

#2048

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant