Skip to content

Conversation

duyhungtnn
Copy link
Collaborator

Simplified network error detection by checking only the NSURLErrorDomain and handling timeout errors separately. Moved the list of network error codes used for testing from BKTError to BKTErrorTests, and updated related test logic. Improved comments for clarity in error handling.

Simplified network error detection by checking only the NSURLErrorDomain and handling timeout errors separately. Moved the list of network error codes used for testing from BKTError to BKTErrorTests, and updated related test logic. Improved comments for clarity in error handling.
@duyhungtnn duyhungtnn requested a review from Copilot September 22, 2025 09:39
Copy link

@Copilot 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 simplifies network error detection by treating all NSURLErrorDomain errors as network errors, except for timeout errors which are handled separately. This removes the need to maintain a hardcoded list of specific network error codes in the production code.

  • Simplified error handling logic by checking only the NSURLErrorDomain instead of specific error codes
  • Moved the network error codes list from production code to test-only code
  • Updated test references and improved error handling comments

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
BKTError.swift Simplified network error detection logic and removed hardcoded network error codes list
BKTErrorTests.swift Added test-specific network error codes list and updated test references
ApiClientImpl.swift Enhanced comments for clarity in error handling logic

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant