Improve error handling in answerHost by eliseomartelli · Pull Request #226 · apple/container
Navigation Menu
{{ message }}
- Notifications You must be signed in to change notification settings
- Fork 676
Merged
jglogan merged 1 commit intoapple:mainfrom
Jun 27, 2025Merged
Improve error handling in answerHost#226
jglogan merged 1 commit intoapple:mainfrom
Improve error handling in answerHost#226
jglogan merged 1 commit intoapple:mainfrom
Conversation
Copy link
Contributor
eliseomartelli
commented
Jun 17, 2025
eliseomartelli
commented
Refactor answerHost to throw descriptive DNSResolverError instances
instead of returning nil when IP allocation or parsing fails.
Copy link
Contributor
Arer you sure we need to throw errors here? As far as I understood, the server collects results from different places and return .nonExistentDomain if nothing found
https://github.com/apple/container/blob/main/Sources/DNSServer/DNSServer%2BHandle.swift#L59-L61
jglogan requested changes Jun 17, 2025
Sources/APIServer/ContainerDNSHandler.swift
Outdated
Show resolved
Hide resolved
Sources/APIServer/ContainerDNSHandler.swift Outdated Show resolved Hide resolved
Sources/APIServer/ContainerDNSHandler.swift
Show resolved
Hide resolved
Sources/APIServer/ContainerDNSHandler.swift Show resolved Hide resolved
Sources/APIServer/ContainerDNSHandler.swift
Show resolved
Hide resolved
Sources/APIServer/ContainerDNSHandler.swift Show resolved Hide resolved
Refactor answerHost to throw descriptive `DNSResolverError` instances instead of returning nil when IP allocation or parsing fails.
eliseomartelli
force-pushed
the
eliseomartelli/throwerrors
branch
from
d5ab862 to
59ff0ce
Compare
eliseomartelli
requested a review
from jglogan
Abdullah4345 approved these changes Jun 22, 2025
jglogan approved these changes Jun 27, 2025
Copy link
Contributor
jglogan
commented
Jun 27, 2025
jglogan commented
Jun 27, 2025@eliseomartelli Sorry for the delay, I was traveling this week. Approved and merged, thanks for improving those error responses!
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