[TIMOB-16672] Windows Hybrid: Downloading a file while offline crashes the app
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-03-25T19:46:20.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2014 Sprint 06, 2014 Sprint 06 Tooling, Release 3.3.0 |
Components | Windows Hybrid |
Labels | module_hybrid, qe-testadded |
Reporter | Chris Barber |
Assignee | Chris Barber |
Created | 2014-03-23T02:23:48.000+0000 |
Updated | 2014-05-20T20:12:23.000+0000 |
Description
When testing downloading a file using tiwp8.downloadFile() and your device is offline, the app crashes. We need to capture the error and properly throw an exception.
On a side note, the XHR proxy seems to report 400 bad request for all requests when offline. That may be ok, but check what other environments do when offline and perhaps throw a better error.
IMPORTANT API CHANGE!
downloadFile() signature had to change to accommodate the onerror handler:Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5525 3_2_X_hybrid pull request: https://github.com/appcelerator/titanium_mobile/pull/5526
Verified fixed on: Windows 8.1 Appcelerator Studio, build: 3.3.0.201405121247 Titanium SDK, build: 3.3.0.v20140514121712 Titanium CLI, build: 3.3.0-dev Windows SDK: 8.0 Nokia Lumia 520: 8.0 PDF file is downloaded successfully while network is connected. App does not crash if network is not connected. Closing.