Skip to content

Improve handling of 404 errors from Apple developer website#14

Merged
mattt merged 1 commit intomainfrom
mattt/better-404-handling
Sep 12, 2025
Merged

Improve handling of 404 errors from Apple developer website#14
mattt merged 1 commit intomainfrom
mattt/better-404-handling

Conversation

@mattt
Copy link
Copy Markdown
Member

@mattt mattt commented Sep 12, 2025

No description provided.

@mattt mattt requested a review from Copilot September 12, 2025 20:22
Copy link
Copy Markdown

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 404 responses from the Apple developer website by introducing a custom NotFoundError exception and providing user-friendly error responses with helpful guidance.

  • Adds a custom NotFoundError class to distinguish 404 errors from other HTTP errors
  • Implements specific 404 handling that throws NotFoundError when Apple documentation pages are not found
  • Provides enhanced error responses with helpful guidance and example URLs for both JSON and markdown content types

Reviewed Changes

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

File Description
src/lib/fetch.ts Adds NotFoundError class and throws it specifically for 404 responses from Apple documentation
src/index.ts Imports NotFoundError and adds comprehensive error handling with user-friendly 404 responses

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/index.ts
Comment on lines +171 to +173
- [Swift Documentation](https://sosumi.ai/documentation/swift)
- [SwiftUI Documentation](https://sosumi.ai/documentation/swiftui)
- [UIKit Documentation](https://sosumi.ai/documentation/uikit)
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

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

The hardcoded domain 'sosumi.ai' in the example URLs should be dynamically determined from the request context to ensure accuracy across different deployment environments.

Copilot uses AI. Check for mistakes.
@mattt mattt merged commit bbf2b23 into main Sep 12, 2025
2 checks passed
@mattt mattt deleted the mattt/better-404-handling branch September 12, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants