{ "id": "80364", "key": "TIMOB-5294", "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": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2016-11-02T11:41:38.000+0000", "created": "2011-09-15T14:49:28.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api", "parity", "tbs-2.1.0" ], "versions": [ { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "issuelinks": [ { "id": "12756", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "63015", "key": "TIMOB-2383", "fields": { "summary": "HTTPClient doesn't trigger \"onerror\" with 4xx and 5xx HTTP response codes", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "13734", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "82194", "key": "TIMOB-5937", "fields": { "summary": "Update CreateHTTPClient to better align with the XMLHttpRequest spec", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-03-31T17:29:33.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Description:\r\nWhile trying to verify and close TIMOB-2383, I ran a modified version of the sample code (From Dawson) listed in the bug. While the code did trigger the \"onerror\" with 4xx and 5xx response codes, the alert produced a response of \"Undefined\" for e.error. This functions as expected on Android. Due to TIMOB-2383, I was unable to test this in 1.7.2.\r\n\r\n{CODE}\r\nvar win = Ti.UI.createWindow({ backgroundColor: '#fff' });\r\nvar lbl = Ti.UI.createLabel({\r\n text: 'Waiting for response...', color: '#000',\r\n top: 40, left: 10,\r\n width: 300\r\n});\r\nwin.add(lbl);\r\nwin.open();\r\n\r\nvar xhr = Ti.Network.createHTTPClient({\r\n onload: function(e) {\r\n alert('FAIL! \"onload\" ran when we got the error code ' + this.status + ' from the server!');\r\n },\r\n onerror: function(e) {\r\n alert('Error: ' + e.error);\r\n }\r\n});\r\nxhr.open('GET', 'http://appc.me/test/simulateresponse?code=404');\r\nxhr.send();\r\n{CODE}\r\n\r\nSteps to reproduce:\r\n1) Create a new mobile project in studio targeting SDK 1.8.0\r\n2) Use the attached code for your app.js\r\n3) Run in simulator or on iOS device\r\n\r\nResult:\r\nAlert produced as seen in that attached image (note, this is from my slightly modified version of the attached code above)\r\n\r\nExpected:\r\nAnd alert produced with text similar to: \"Error: This is a custom status description for error code 500!\"\r\n\r\nNotes:\r\nCould not test in 1.7.2\r\nDoes not occur on Android", "attachment": [ { "id": "22952", "filename": "onerrorResult.png", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-15T14:49:28.000+0000", "size": 86872, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: HTTPClient onerror response is returning \"undefined\"", "creator": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Studio, build: 1.0.5.201109091616, SDK 1.8.0.v20110914184549 on an iPad 2, 4.3.5 and iPod touch 3rd Gen 4.0.2.", "comment": { "comments": [ { "id": "400244", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi Eric. Just tested with our recent SDK's (5.5.x, 6.x) and am not able to reproduce the issue anymore. I guess it was fixed over the last 5 years, hehe.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-11-02T11:41:38.000+0000", "updated": "2016-11-02T11:41:38.000+0000" }, { "id": "416510", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket with reference to the above comment.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-31T17:29:33.000+0000", "updated": "2017-03-31T17:29:33.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }