{ "id": "148937", "key": "TIMOB-19042", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "16723", "description": "Windows Platform Support, ListView updates, Vector overlays in maps", "name": "Release 4.1.0", "archived": false, "released": true, "releaseDate": "2015-07-08" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-06-24T13:57:22.000+0000", "created": "2015-06-18T20:38:19.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "qe-4.1.0" ], "versions": [ { "id": "16723", "description": "Windows Platform Support, ListView updates, Vector overlays in maps", "name": "Release 4.1.0", "archived": false, "released": true, "releaseDate": "2015-07-08" } ], "issuelinks": [], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2015-06-30T18:09:31.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "h5.Description\r\n\r\nWhen doing a HTTP GET on an incorrect URL the HTTPClient will throw onLoad rather than onError. \r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\r\n\r\nvar lbl = Ti.UI.createLabel({\r\n text: 'Tap me!',\r\n color: 'black'\r\n})\r\n\r\nvar url = 'http://httpbin.org/gert';\r\n\r\nlbl.addEventListener('click', function(){\r\n\r\n var client = Ti.Network.createHTTPClient({\r\n onload : function(e) {\r\n alert('onload');\r\n },\r\n onerror : function(e) {\r\n alert('onerror');\r\n }\r\n });\r\n client.open('GET', url);\r\n client.send();\r\n});\r\n\r\n\r\nwin.add(lbl);\r\nwin.open();\r\n{code}\r\n\r\nh5.Steps To Reproduce\r\n\r\n1. Add the above code to an app.js\r\n2. Build to a device or emulator\r\n3. Tap the label\r\n\r\nh5.Actual Result\r\n\r\nAn alert will be shown with onload\r\n\r\nh5.Expected Result\r\n\r\nAn alert should be shown with onerror", "attachment": [], "flagged": false, "summary": "Windows: HTTPClient GET on an incorrect URL throws onload instead of onerror", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "Windows 8.1\r\nTi CLI: 4.1.0-dev\r\nTi SDK: 4.1.0.v20150617152826\r\nLumia 928: 8.1\r\nWindows Phone emulator 8-1-1", "closedSprints": [ { "id": 436, "state": "closed", "name": "2015 Sprint 13 Windows", "startDate": "2015-06-20T23:02:43.965Z", "endDate": "2015-07-04T23:02:00.000Z", "completeDate": "2015-07-06T14:03:22.174Z", "originBoardId": 144 } ], "comment": { "comments": [ { "id": "355768", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "[~eharris] What is the typical behavior on other platforms? Does it fire onerror for any 400+ or 500+ status codes, and onload for 200/300+ codes?", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2015-06-23T17:21:18.000+0000", "updated": "2015-06-23T17:21:18.000+0000" }, { "id": "356429", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\nWe get onerror now .\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio: 4.1.0.201506261427\r\nTi SDK: 4.1.0.v20150630084319\r\nTi CLI: 4.0.1\r\nAlloy: 1.6.2\r\nWindows: 8.1 Enterprise 64-bit\r\nAPPC NPM: 4.1.0-1\r\nAPPC CLI: 4.1.0-4 \r\nDevice: Nokia Lumia 928 - Windows Phone 8.1\r\nWindows emulator : 8.1", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-06-30T18:09:17.000+0000", "updated": "2015-06-30T18:09:17.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }