Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented Apr 5, 2024

See discussion at
#777 (comment) with @crazytonyli

Testing Details

See green CI.


  • Please check here if your pull request includes additional test coverage. — N.A.
  • I have considered if this change warrants release notes and have added them to the appropriate section in the CHANGELOG.md if necessary. — N.A.

let jetpackError = JetpackInstallError(
title: endpointError.localizedDescription,
code: endpointError.errorCode,
key: endpointError.errorUserInfo[WordPressComRestApi.ErrorKeyErrorCode] as? String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you can do endpointError.apiErrorCode instead of using errorUserInfo.


let status = RewindStatus(state: .unavailable)
success(status)
failure(endpointError)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code returns error. But there it's changed to endpointError. I don't think we should change it here?

guard error.castedToEndpointErrorWitCode(.preconditionFailure) != nil else {
success(RewindStatus(state: .unavailable))
return
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My brain can't process these two guard statements. But, are their logic changed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed an unit test failed, I think this guard change here might be the cause?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants