Open
Conversation
3 tasks
9807ec5 to
e3a0814
Compare
47291d5 to
77a9ba4
Compare
Add `request_url` and `request_method` fields to `WpApiError`, `RequestExecutionError`, and `WpNetworkResponse` so error messages include which request failed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pass requestUrl and requestMethod to all error catch blocks in executeRequestSafely and remove default parameter values to prevent future regressions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
77a9ba4 to
44cb12f
Compare
crazytonyli
reviewed
Feb 26, 2026
| error_message: "Execute function is not necessary for these tests".to_string(), | ||
| }, | ||
| request_url: String::new(), | ||
| request_method: RequestMethod::GET, |
Contributor
There was a problem hiding this comment.
This should use the _request argument.
| status_code: 200, | ||
| response_header_map: WpNetworkHeaderMap::default().into(), | ||
| request_url: WpEndpointUrl("http://example.com".to_string()), | ||
| request_method: RequestMethod::GET, |
Contributor
There was a problem hiding this comment.
Should use the request argument.
| error_message: "upload_media is not used".to_string(), | ||
| }, | ||
| request_url: String::new(), | ||
| request_method: RequestMethod::POST, |
Contributor
There was a problem hiding this comment.
Should use the _request argument.
| error_message: "Network timeout".to_string(), | ||
| }, | ||
| request_url: "https://test.local/wp-json".to_string(), | ||
| request_method: RequestMethod::GET, |
Contributor
There was a problem hiding this comment.
Should use the request argument.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Error messages from the WordPress API are much more useful when they include which request failed. Previously, errors like
RequestExecutionFailedorInvalidHttpStatusCodecarried no information about the originating request, making it difficult to debug failures — especially when multiple requests are in flight.request_urlandrequest_methodfields toWpApiError,RequestExecutionError, andWpNetworkResponseRequestMethodis non-optional everywhere since errors always originate from a known HTTP requestWpRequestResult,WpRequestExecutor,ApiClientHelpers)SafeRequestExecutor,Extensions, test helpers)LoginTestscompilation error by updating from removedfindLoginUrl(forSite:)to currentdetails(ofSite:)APITest plan
cargo test --libpasses (108 tests)./gradlew :example:composeApp:assembleDebug)swift buildsucceedsswift build --build-testssucceeds🤖 Generated with Claude Code