timsutton / speedwagon

Download iOS/tvOS/watchOS/xrOS simulators without Xcode or macOS
MIT License
125 stars 4 forks source link

Make panics more readable #2

Closed dnicolson closed 1 year ago

dnicolson commented 1 year ago

This pull request improves the readability when there are network errors.

The devimages-cdn.apple.com hostname seems to have some issues at the moment, and am frequently getting unexpected EOF errors but they're not very readable. Unlike Xcode, at least the downloads are able to be resumed.

Before:

Downloading https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.AppleTVSimulatorSDK15_0-15.0.1.1633542405.dmg...
   0% |                                            | (2.2 MB/2.7 GB) [2m16s:0s]panic: read tcp [2001:9e8:afa:1c01:21a6:6d80:595d:325]:52963->[2a01:b740:a26:f100::6]:443: read: operation timed out

After:

Downloading https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.AppleTVSimulatorSDK15_0-15.0.1.1633542405.dmg...
   0% |                                            | (2.4 MB/2.7 GB) [2m15s:0s]

panic: read tcp [2001:9e8:afa:1c01:d4cb:369a:534d:54c5]:57315->[2a01:b740:a26:f100::6]:443: read: operation timed out
timsutton commented 1 year ago

Thanks! One of my TODOs on this project was to add better error handling in general. Even just making the panic here more readable is a great start :)

dnicolson commented 1 year ago

Thanks! One of my TODOs on this project was to add better error handling in general. Even just making the panic here more readable is a great start :)

Maybe a retry option would be useful, I am needing to restart downloads dozens of times due to "unexpected EOF", "connection reset by peer" and "TLS handshake timeout" network errors.