fix(fetchZyfiSponsored): enhance error handling and logging#118
Merged
Conversation
Updated the fetchZyfiSponsored function to improve error handling by logging the response status and body when a fetch fails. This change provides clearer insights into the failure reasons. Additionally, adjusted the response parsing to use a single await for the response body, ensuring consistency in handling the response data.
LCOV of commit
|
Move operation-tagged logging into fetchZyfiSponsored so all call sites (register, set-text-record, legacy index route) share the same format and error output includes HTTP status plus response body. Co-authored-by: Cursor <cursoragent@cursor.com>
aliXsed
approved these changes
Jul 8, 2026
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
Centralizes ZyFi paymaster logging in
fetchZyfiSponsoredso every call site shares the same format.logZyFi request [operation]: …logZyFi response [operation]: …errorZyFi error [operation] {status} {statusText}: …Call sites pass an operation label (
register,set-text-record) instead of duplicating log statements. The legacy register route inindex.tsis included for consistency.Errors throw with the operation name and API message (or serialized body) for easier tracing in request logs.
Test plan
[register][set-text-record]