Skip to content

Conversation

@SgtPooki
Copy link
Collaborator

@SgtPooki SgtPooki commented Nov 13, 2025

  • getErrorMessage function to wrap original error and get valid string
  • use errors in error messages returned to user
  • wrap fetch to ipni indexer with try/catch to handle errors here so we can continue with retry.

Added test that was failing before the fixes.. now passing. Updated tests with new error message expectations

Fixes #236

@FilOzzy FilOzzy added team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board. labels Nov 13, 2025
@FilOzzy FilOzzy added this to FS Nov 13, 2025
@github-project-automation github-project-automation bot moved this to 📌 Triage in FS Nov 13, 2025
Copy link
Collaborator Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

self review

@SgtPooki SgtPooki requested a review from Copilot November 13, 2025 16:00
@SgtPooki SgtPooki self-assigned this Nov 13, 2025
Copilot finished reviewing on behalf of SgtPooki November 13, 2025 16:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves error handling for IPNI indexer operations by introducing proper fetch error catching and more informative error messages. The changes enable the system to gracefully handle and retry network errors when querying the IPNI indexer, rather than failing immediately.

Key changes:

  • Added getErrorMessage utility function to safely extract error messages from unknown error types
  • Wrapped IPNI indexer fetch calls in try-catch blocks to handle network errors and enable retries
  • Enhanced error messages throughout to include underlying error details using the new utility

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/core/utils/errors.ts New utility function to safely extract error messages from unknown error types
src/core/utils/validate-ipni-advertisement.ts Added try-catch around fetch calls, improved error messages with detailed context, and handles non-ok responses
src/test/unit/validate-ipni-advertisement.test.ts Updated test to verify retry behavior on fetch errors, updated expected error message format to include full context

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SgtPooki SgtPooki merged commit 996af92 into master Nov 13, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from 📌 Triage to 🎉 Done in FS Nov 13, 2025
@SgtPooki SgtPooki deleted the fix/ipni-throwing-immediately branch November 13, 2025 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team/filecoin-pin "Filecoin Pin" project is a stakeholder for this work. team/fs-wg FOC working group is a stakeholder for this work, and thus wants to track it on their project board.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IPNI Advertisement Check Fails Prematurely

3 participants