-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Improve error message for 'package-registry publish' #6576
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
Conversation
Motivation: When registry publish fails with client error, the current error message is "Error: failed publishing: invalid registry response status '400', expected '[201, 202]'", which doesn't provide much information on what went wrong. rdar://109410245 Modifications: - Wrap 4xx status response in `RegistryError.clientError` and 5xx in `RegistryError.serverError`. Both errors include response body as details. - Change `package-registry publish` to throw the wrapped `clientError` such that more details (i.e., response body) get displayed.
@swift-ci please smoke test |
"\(packageIdentity) version \(packageVersion) was successfully submitted to \(registryURL) and is being processed. Publishing status is available at '\(statusURL)'." | ||
) | ||
} | ||
} catch RegistryError.failedPublishing(let error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about this change - we had cases in the past where we were missing the context and the fact the error is in publishing is material context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? That not all failedPublishing
is from failed publishing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I meant this change strips the the "FailedPublishing" context, and the underlying error could be hard to reason about without that context. we had a similar issue in the login flow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I reverted this part of the change. The introduction of .clientError
should be good enough.
63b9f7a
to
cc3cc1c
Compare
@swift-ci please smoke test |
@swift-ci please test Windows platform |
* Improve error message for 'package-registry publish' Motivation: When registry publish fails with client error, the current error message is "Error: failed publishing: invalid registry response status '400', expected '[201, 202]'", which doesn't provide much information on what went wrong. rdar://109410245 Modifications: - Wrap 4xx status response in `RegistryError.clientError` and 5xx in `RegistryError.serverError`. Both errors include response body as details. - Change `package-registry publish` to throw the wrapped `clientError` such that more details (i.e., response body) get displayed. * Don't lose failedPublishing context
* Improve error message for 'package-registry publish' Motivation: When registry publish fails with client error, the current error message is "Error: failed publishing: invalid registry response status '400', expected '[201, 202]'", which doesn't provide much information on what went wrong. rdar://109410245 Modifications: - Wrap 4xx status response in `RegistryError.clientError` and 5xx in `RegistryError.serverError`. Both errors include response body as details. - Change `package-registry publish` to throw the wrapped `clientError` such that more details (i.e., response body) get displayed. * Don't lose failedPublishing context
Motivation:
When registry publish fails with client error, the current error message is "Error: failed publishing: invalid registry response status '400', expected '[201, 202]'", which doesn't provide much information on what went wrong.
rdar://109410245
Modifications:
RegistryError.clientError
and 5xx inRegistryError.serverError
. Both errors include response body as details.package-registry publish
to throw the wrappedclientError
such that more details (i.e., response body) get displayed.